Unexpanded shortcodes in search engine results

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.

Related posts

Leave a Reply

1 comment

  1. 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 …