[resolved] [shortcode] text itself shows up in search engine results (4 posts)

  1. navigadget
    Posted 6 years ago #

    I'm using [adsense] shortcode to insert google ads into the body of my blog posts.

    It works fine but somehow Google manages to show the actual text "[adsense]" in the search results.

    Example: Google "Amod GPS Photo Tracker review" and look for results from Navigadget. You'll see:

    Jul 27, 2009 ... [adsense]This is how I like to review things blah blah..

    What am I doing wrong? How does the crawler gets to see the shortcode?

  2. navigadget
    Posted 6 years ago #

    Could it be because I use a plugin (Google XML Sitemaps) that could notify search engines without executing the [shortcode].

    Help please.

  3. alism
    Posted 6 years ago #

    Have a look at the page source of this page:

    The text Google is using for their snippet is from your META Description, which does indeed show "[adsense]" as part of the text.

    So I'd look at the Add-Meta-Tags plugin first. Is it automatically adding the first paragraph in, regardless of short code? Or have you accidently just pasted the whole paragraph in, shortcode and all?

  4. navigadget
    Posted 6 years ago #

    alism you are right. Thank you so much. It is the META description which is filled in by Add-Meta-Tags.

    This should've been the first thing I checked.

    Quick and dirty fix was to modify the plugin file: "add-meta-tags/add-meta-tags.php"

    I added this line right before return $amt_excerpt

    $amt_excerpt = preg_replace('/\[adsense\]/', '', $amt_excerpt);

    I'm open to suggestions for a better and more permanent fix.

Topic Closed

This topic has been closed to new replies.

About this Topic