Starting in WordPress 2.6, they’ve added captions to images that are automatically generated and use the Shortcode API to make it happen. One side effect is that All in One SEO Pack isn’t set up to strip the caption from the automatically generated META tags, so you may end up with in your description.
Thanks to a WordPress Trac entry, I got the right regular expression to strip all shortcode in All in One plugin.
Make the following changes to fix the SEO pack problem:
Edit the file all_in_one_seo_pack.php.
On Line 1059, find:
function trim_excerpt_without_filters($text) {
$text = str_replace(']]>', ']]>', $text);
Below it, add:
$text = preg_replace( '|\[(.+?)\](.+?\[/\\1\])?|s', '', $text );
On Line 1074, find:
function trim_excerpt_without_filters_full_length($text) {
$text = str_replace(']]>', ']]>', $text);
Below it, add:
$text = preg_replace( '|\[(.+?)\](.+?\[/\\1\])?|s', '', $text );
That should do it! Let me know if there are any issues that come up.
Related posts:
Pingback: How to turn off captions in WordPress 2.6 « Denver Web Design & Denver SEO - The Katz Web Design Blog