How I can remove the non-existing pages URL from Google.
There are a lot of pages which doesn't exist on our website. How to remove their URL from Google.
How I can remove the non-existing pages URL from Google.
There are a lot of pages which doesn't exist on our website. How to remove their URL from Google.
robots.txt
fileThis method can be used to remove an unwanted page or an entire section from the results. To do this, you must have access to the root folder of the domain. This file should contain the following lines:
User-agent
: here you will need to enter the name of the robot to which the ban will be applied.Disallow
: Here you will need to enter the address itself.
In this case you will also have to wait for reindexing, until it will not be thrown out of the index. You can, of course, send the page forcibly on the relinking, but that's another story.If the pages are minimal, you can submit in the Google Search Console - Removal Tool found here: https://www.google.com/webmasters/tools/removals
If the pages are greater, you can submit a new sitemap to let Google update your indexed URLs and give time for them to de-index the irrelevant URLs as long as they are not found or have the 'noindex' tag.
In both of the cases, if you're not aware why lot of pages are appearing on your website that you have not created, please check the following:
410 Gone
with PHP, like:<?php
if ($_SERVER['REQUEST_URI'] == '(pattern1|pattern2)') {
header ("HTTP/1.1 410 Gone");
}
?>
On this way Google learns quickly, that these urls don't exist and de-indexes them quickly.
Another way is to fire noindex
with X-Robots-Tag, like
<?php
if ($_SERVER['REQUEST_URI'] == '(pattern1|pattern2)') {
header("X-Robots-Tag: noindex, nofollow", true);
}
?>
but the de-indexing happens (much) slower.