Posts Tagged ‘Add-Meta-Tags’

Sunday, March 8th, 2009

While I was tinkering with my blog site, trying to (somehow) optimize it. I’ve noticed that the “Meta-Description” in which the Add-Meta-Tags generates, included the “[ caption ]” shortcode in the header’s meta-description, that is if I have an embedded image on my post. SEO professionals would say that “it’s a big No no!”. So, what’s a guy gotta do? Remove it! But then I still want a caption for my embedded images (on posts). So, editing every post and removing the code manually will not do.

I’d searched a fix on google but no luck. But, I’ve found one for All-In-One-SEO-Pack using regular expression to strip all shortcode. Tried it on Add-Meta-Tags and you guessed it! It worked!

Here’s how to you do it:

  1. Edit your ‘add-meta-tags.php‘ from ‘/wp-content/plugins/add-meta-tags-1.6‘ directory.
  2. Search for the function ‘amt_clean_desc
  3. Then add this code (one line before ‘return trim($desc);‘):
    $desc = preg_replace('|\[(.+?)\](.+?\[/\\1\])?|s', '', $desc);
    
  4. Save it then upload it back to the server.

That’s it!