Mobile app version of vmapp.org
Login or Join
Vandalay111

: New URLs not being indexed After renaming my files, I can't see the new one indexed by Google when I do site://www.example.com. I am still getting the old files only, and these old files are

@Vandalay111

Posted in: #GoogleSearchConsole

After renaming my files, I can't see the new one indexed by Google when I do site://www.example.com. I am still getting the old files only, and these old files are giving 404 as the file has been renamed.

I updated my sitemap.xml but why is it that Google is not indexing my new files?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Vandalay111

1 Comments

Sorted by latest first Latest Oldest Best

 

@Holmes151

...these old files are giving 404 as the file has been renamed.


You should implement (permanent) 301 redirects from the old URL to the new URL. Only by implementing a permanent redirect will the search engines (ie. Google) know that the old URL has changed to the new URL. This is essential in order to preserve any SEO on the old URL structure that you might have had.

Google doesn't necessarily see a 404 as a permanent error - it gives you a chance, as this might have been the result of a temporary (erroneous) change on your site. But eventually these old 404 URLs will drop out of the index - but it will take time. If you haven't implemented a redirect then these old URLs will simply drop out of the index. Without a redirect from the old URL to the new then you are essentially starting from the very beginning in terms of SEO, which can take weeks, or longer.

Even with redirects in place it can take time for the new URLs to be indexed, depending on how frequently Googlebot visits your site.



UPDATE: As mentioned in comments, if you simply want those old URLs to drop out of the search index quicker (and are not concerned with preserving SEO) then you can issue a 410 Gone HTTP response status instead of the usual 404 Not Found for these old URLs.


I can use header("HTTP/1.0 410 Gone"); in a file which we don't want but in my case files exist, I have only renamed them. Do you have any other solution to use 410 for my case?


If you have a custom 404 error document then you can do the same thing from your 404 error document - essentially turning all "404 Not Found" errors into a "410 Gone". For example, on Apache:

In .htaccess or your server config:

# Define your custom 404 error document
ErrorDocument /errordocs/e404.php


Then, inside /errordocs/e404.php:

<?php
// 404 error document, but override with a 410
header("HTTP/1.0 410 Gone");
?>
<html>
<head><title>410 Gone</title></head>
<body>
<h1>410 Gone</h1>
<p>This page has gone for good.... <a href="/">Home</a></p>
:


However, unless you identify all the "old" URLs, then this approach (or any approach) will result in a 410 Gone being served for all non-existent URLs - whether they existed previously or not (or may exist in the future). Note that, as suggested above, 410s are less forgiving by the search engines if you make a mistake.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme