Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have some shortcodes on pages e.g. [fb_like] [twg_gpo_button] [ratings]. If I visit page they expand correctly but on search engine results page, they do not expand on some pages. I have installed W3 Total Cache plugin. Is this due to it?

What should I do to prevent this in future? I want to remove such pages from search engines results too.

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

The easiest way to see if W3 Total Cache is the cause would be to disable the plugin and see if that fixes the issue.

But what you're seeing is an unfiltered post. Usually, the content of the post is passed through the_content filter, and those shortcodes are replaced. Something in your search results is skipping this.

It could be that you're getting some cached, unprocessed content. It could also be that your search result template is echoing $post->post_content instead of calling the_content().


Since you're using Google search, Google will index the meta description tag of your posts rather than the actual content. By default, most themes and SEO plugins will try to auto-fill the description tag with some kind of excerpt of your post content.

It looks like the auto-generated excerpt on your site is not passing content through typical content filters. This is actually what I'd expect.

To prevent this from happening in the future, you'll need to manually create your excerpt. You can do this by filling in the Excerpt box on the post edit screen, or manage it separately by using an SEO plugin and populating the Description field directly.

Here's a great article explaining why you should avoid auto-generating post descriptions ...

share|improve this answer
    
Thanks! Google results exhibit this problem. My page.php calls the_content(). It seems when Google indexes these pages, something goes wrong. –  afnrf May 30 '12 at 19:05
    
No, I got it. It has something to do with <meta name="description" ... > These expanded codes are actually set there. –  afnrf May 30 '12 at 19:09
    
See my edit re: meta descriptions. They're likely being auto-generated ... and that's a bad thing. –  EAMann May 30 '12 at 19:26
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.