A few days ago, my site was affected by malware. There were lot of URLs that linked to my site and the malware used to redirect to some place. I have gotten rid of all the malware, but still there are a lot of URLs that appear as, linked to my website and is being reported as 404 errors. How do I get rid of those, so that I stop getting these 404 errors in my webmaster tool.

Mine is a static site with ust 1 page, so no way there could be these many indexed

There are content keywords that are nowhere on my page. How do I remove unwanted content keywords from this list?

These are all the 404 errors because these pages do not exist and were created by the malware

It shows from where those 404 links were coming

  • 2
    As a side note, NEVER NEVER NEVER mark a valid 404 error as being fixed in Search Console. DON'T DO IT!!! Ever! Getting my drift? ;-) (You have suffered enough already.) Cheers!!
    – closetnoc
    Jun 23, 2016 at 21:43
  • @closetnoc What would it do? Jun 24, 2016 at 1:33
  • @BalinKingOfMoria Google will retry a page that gives a 404 error a certain number of times over a period of time. After that, it will stop and every long period of time check again just in case. If you mark a 404 error for a page that does not exist as fixed, you are telling Google that the page should exist and to try again. Essentially, the counter/clock gets reset and the process starts over again. It is one of those confusing things Google never explains. Thanks for asking! Cheers!!
    – closetnoc
    Jun 24, 2016 at 2:36
  • @closetnoc Thanks for the explanation :) Makes sense! Jun 24, 2016 at 2:49
  • @BalinKingOfMoria Anytime! We are always here for you.
    – closetnoc
    Jun 24, 2016 at 2:50

3 Answers 3


Unfortunately there's not much you can do. You can't prevent these other (hacked) sites from linking to you. Besides, once Google has found these (now erroneous) URLs, it is likely to continue crawling them for sometime to come, even when the inbound link is (eventually) removed.

You are already doing the correct thing, in returning a 404. A genuine 404 is not a bad thing, but (as you have found) it is annoying that they unnecessarily pollute your reports.

You can try returning a 410 Gone instead, but if the URLs aren't actually indexed anyway then it probably won't make that much of change to the GSC report (at least initially).

  • Thanks for your help! I like the idea of returning 401. Would it make sense if I set up an .htaccess rule for links like these and return a 401?
    – gentrobot
    Jun 23, 2016 at 21:30
  • 2
    That's a "410 Gone", not a "401 Unauthorized" btw. Yes you could do this in .htaccess - if there is a certain pattern to these invalid URLs (that could be the tricky bit). You don't necessarily want to convert all 404s into 410s - although you could.
    – DocRoot
    Jun 23, 2016 at 21:38

You may also want to disavow these links.

It could potentially appear like you purchased links from a garbage SEO provider helping to sell you links to increase your rankings. This behavior gets penalized commonly, and you'll need to disavow those links to Google knows that you were weren't hoping to get any ranking benefit from the added backlinks.

You can find the links you need to disavow a variety of ways (Google's Search Console, Majestic, Ahrefs, and OpenSiteExplorer.org are some sites that come to mind). And then go into Google's Search Console in your webmaster account and open up the disavow tool. Remember, if it's ultra spammy stuff, you'll likely want to disavow from the domain level and not just a specific URL.


Probably you will find the procedure in here:

Disavow backlinks

This is a two-step process. First, you’ll need to download a list of links to your site. Next, you’ll create a file containing only the links you want to disavow and upload this to Google.

Download links to your site

Choose the site you want on the Search Console home page.
On the Dashboard, click Search Traffic, and then click Links to Your Site.
Under Who links the most, click More.
Click Download more sample links. If you click Download latest links, you'll see dates as well.

Note: When looking at the links to your site in Search Console, you may want to verify both the www and the non-www version of your domain in your Search Console account. To Google, these are entirely different sites. Take a look at the data for both sites. More information

You’ll download a file containing all the pages linking to your site. Use this to create a text file (the file type must be .txt and it must be encoded in UTF-8 or 7-bit ASCII) containing only the links you want to disavow—one link per line. If you want Google to ignore all links from an entire domain (like example.com), add the line "domain:example.com". Your text file can include additional information about excluded links, as long as each line of description begins with the "#" character (all lines beginning with # will be ignored). Don't upload the entire list of links to your site: the text file that you upload is the list of links you want Google to ignore.


Here's a sample of a valid file

-example.com removed most links, but missed these http://spam.example.com/stuff/comments.html http://spam.example.com/stuff/paid-links.html

-Contacted owner of shadyseo.com on 7/1/2012 to -ask for link removal but got no response domain:shadyseo.com

If you want Google to ignore all links from an entire domain (like example.com), add the line domain:example.com.

Upload a list of links to disavow

Go to the disavow links tool page.
Select your website.
Click Disavow links.
Click Choose file.

# Note: Uploading a new file will replace all previously uploaded ones.

It may take some time for Google to process the information you’ve uploaded. In particular, this information will be incorporated into our index as we recrawl the web and reprocess the pages that we see, which can take a number of weeks. These links will continue to be shown in the Search Console inbound links section.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.