WordPress.org

Ready to get started?Download WordPress

Forums

RSS Feed appearing in Google (5 posts)

  1. stutley
    Member
    Posted 8 years ago #

    Maybe I just don't know how WordPress works, but after submitting my RSS-feed to various sites, the feed started appearing in Google. No problem except for the fact that it appeared instead of the URLs to my posts, so suddenly I didn't get traffic on the actual site.

    As such, I made a little workaround since Google takes forever to crawl my site again. I coded a little snippet and placed it in the /feed subdirectory (which would usually redirect to the actual RSS-feed.

    I named the file index.php so whenever Google would refer a visitor to the blog.com/feed directory, this would happen:

    <?php

    $parts = explode('&', substr($_SERVER['HTTP_REFERER'], strpos($_SERVER['HTTP_REFERER'], 'q=')));

    for($i = 0; $i < sizeof($parts); $i++) {
    if(strstr($parts[$i], 'q=')) {
    $key = $i;
    }
    }

    $query = str_replace('q=', '', $parts[$key]);

    ?>

    <html>
    <head>
    <title>Blog</title>
    <META HTTP-EQUIV=Refresh CONTENT="0; URL=http://www.blog.com/index.php?s=<?php echo $query; ?>&sbutt=Search">
    </head>
    <body bgcolor=#ececec>
    </body>
    </html>

    What it does is to find out what the visitor originally searched for on Google. The script reads the Google search query and simply searches the blog with the same query.

    It's far from perfect, but it maintains the traffic to my site until I figure out another way.

  2. chaaban
    Member
    Posted 8 years ago #

    10x for this gr8 post

    i was searching for this long time ago

  3. john74
    Member
    Posted 8 years ago #

    Where to is the feed directory, I do not see one

  4. Samuel Wood (Otto)
    Tech Ninja
    Posted 8 years ago #

    An easier way is to sign up for Google Sitemaps and use a Google Sitemaps plugin to generate a sitemaps for Google to read. Then there's no real messing about, Google knows exactly what to index on your site because your map tells it what to index.

  5. gpaulson
    Member
    Posted 7 years ago #

    I tried puting this code in the /feed/ directory as suggested, but it killed my regular RSS feeds.

    Also, the Google Sitemap tells Google where to go but does not limit where Google goes. So just because a link is not listed in your sitemap.xml file does not mean that it will be 'skipped' by the search bot. That is why you need to have a good robots.txt file too.

    Here is my latest attempt at the robots.txt file to fix the feeds problem, etc:

    Robots.txt, RSS Feeds, etc

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags