Magnolia Ward, at Summerlands Hospital, is set to close on 12 July, a spokesman for Somerset Partnership NHS Foundation Trust said.
Four new beds will open on Pyrland ward in Taunton and other spaces will be found in local care homes.
A new seven-day community outreach service is also being launched.
The Trust's chief operating officer, Andy Heron said: "Having exhausted all recruitment possibilities we were becoming increasingly concerned about our ability to maintain safe nursing levels on every shift at Magnolia Ward and also our increasing reliance on agency staff who do not always know the patients or the ward environment as well as permanent staff when they cover a shift."
He added that hospitals in other parts of the country ran outreach services successfully, which involves supporting dementia patients and their carers in their own homes.
"The development of this service is being led by our senior clinical staff in Yeovil who are convinced that this new service can make a real difference for patients with dementia and their carers," he said.
A seven-bed dementia ward based in Yeovil is to close in July because of ongoing difficulties in recruiting specialist staff.