Our WordPress website was hacked which is now revamped and updated to the WP v5.0.3 but still Tags and 35fc4a-50164960-421910 or 6d285b-31601402-365308 type URLs are indexed in Google.

Can we block Tags-205297- type URLs with robots.txt to URLs starting with Tags sign?

enter image description here

  • Do those pages still work if you click on them? If so you still have more hacking cleanup work to do. – Stephen Ostermiller Jan 31 '19 at 12:18
  • @StephenOstermiller pages are not working if we click on them – edgematrix Jan 31 '19 at 13:58
  • Then Emirodgar's suggestion of using the URL removal tool is probably your best bet. Robots.txt blocks crawling but not indexing. So if you disallow them there, Google won't be able to crawl them to see that they are gone. Using robots.txt will make it take longer to get them removed from Google. – Stephen Ostermiller Jan 31 '19 at 14:06
  • @StephenOstermiller can we remove individual links from the Google URLs Removal Tool? – edgematrix Jan 31 '19 at 14:32
  • Yes, it will be a pain if there are a lot of them though. Your other option is just to wait. They will get removed on their own, but it may take months. – Stephen Ostermiller Jan 31 '19 at 14:40

If your Wordpress has been hacked, the first thing is remove the infection. Follow these instructions.

After that, you could prevent the indexing using noindex tag. You can speed up the deindexation throwing an error 404 or error 410 or with a 301 redirect. Using the robots.txt disallow command will take to long and maybe won't work,

You can also use the URL removal tool but you must delete one URL by the time and it's just temporal so, after that, make sure you use the noindex tag.

  • i have done all these steps and can we block tags url by robots.txt or .htaccess? – edgematrix Jan 31 '19 at 10:22
  • Yes, you can block with robots.txt and through .htaccess you can apply a 301 redirect – Emirodgar Jan 31 '19 at 10:32
  • how do i block these type of URLs 35fc4a-50164960-421910 6d285b-31601402-365308 there are so many URLs indexed on the google with the different numbers? – edgematrix Jan 31 '19 at 11:02
  • @Emirodgar I would caution against suggesting the use of robots.txt to block these pages, because if you block the pages then Googlebot will never see that they are 404/410/301, and they could stay in the search index for a long time. – Maximillian Laumeister Feb 1 '19 at 3:28
  • 1
    @MaximillianLaumeister Indeed, he has to use one of the two options, but not both at the same time. My previous comment was not clear enough. – Emirodgar Feb 4 '19 at 8:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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