RSS Feed appearing in Google
-
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=https://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.
- The topic ‘RSS Feed appearing in Google’ is closed to new replies.