Meta description using existing editable region
I've set up the meta descriptions on all pages of my client's website to use the first 200 characters/full words of the first block of editable text on the page with formatting stripped out, like this:
<meta name="description" content="<?php echo preg_replace('/\s+?(\S+)?$/', '', substr(strip_tags (WA_getCMSContent($database_PowerCMSConnection, $PowerCMSConnection, 'Shared Advice_Resources', 'Dreaming')),0,200)); ?> ... read more " />
It works fine, however the resulting description adds in "Edit[ContentAreaName]" at the start, for example:
<meta name="description" content="EditDreaming
Dreaming is something we all do, every night, irrespective of whether we remember our dreams or not.
When we sleep we go fluctuate through phases of light and deep sleep. One stage of ... read more " />
How do I get rid of "EditDreaming" as I'm not even sure where it's getting that from!