July 10, 2008 by Alex Polski

All in One SEO Pack + runPHP = short meta descriptions

If you use wordpress plugin like runPHP and All in One SEO Pack plugin, you can have a problem. This thing can take place if you insert php tags at the beginning of the post. In this case All in One SEO Pack will truncate the text of the autogenerated meta description tag.

For example, if the beginning of your post is

My <a href="<?php echo get_permalink(15); ?>">previous post</a> was about wordpress.

the autogenerated meta description will not be “My previous post was about wordpress” as you expect, but it will be “My”. This is because of strip_tags php function does not support php tags inside html tags.

To fix this issue just insert the row:

$text = preg_replace('/<\?php.+?\?>/i', '', $text);

in the beginning of the functions trim_excerpt_without_filters and trim_excerpt_without_filters_full_length.

Share and Enjoy:
  • del.icio.us
  • Digg
  • Reddit
  • Ma.gnolia
  • Technorati
  • Propeller
  • Facebook
  • StumbleUpon
  • Furl
  • blogmarks
  • Google
  • YahooMyWeb
  • E-mail this story to a friend!
This entry was posted on Thursday, July 10, 2008 at 5:25 pm and is filed under Wordpress. You can leave a response, or trackback from your own site.

Related posts

« 50 films to see before you die

Image Drop Shadow plugin for wordpress »



Leave a Reply