The Moz Q&A Forum

    • Forum
    • Questions
    • My Q&A
    • Users
    • Ask the Community

    Welcome to the Q&A Forum

    Browse the forum for helpful insights and fresh discussions about all things SEO.

    1. SEO and Digital Marketing Q&A Forum
    2. Categories
    3. Intermediate & Advanced SEO
    4. URL Injection Hack - What to do with spammy URLs that keep appearing in Google's index?

    URL Injection Hack - What to do with spammy URLs that keep appearing in Google's index?

    Intermediate & Advanced SEO
    7 4 3.6k
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as question
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • peteboyd
      peteboyd last edited by

      A website was hacked (URL injection) but the malicious code has been cleaned up and removed from all pages. However, whenever we run a site:domain.com in Google, we keep finding more spammy URLs from the hack. They all lead to a 404 error page since the hack was cleaned up in the code. We have been using the Google WMT Remove URLs tool to have these spammy URLs removed from Google's index but new URLs keep appearing every day. We looked at the cache dates on these URLs and they are vary in dates but none are recent and most are from a month ago when the initial hack occurred.

      My question is...should we continue to check the index every day and keep submitting these URLs to be removed manually? Or since they all lead to a 404 page will Google eventually remove these spammy URLs from the index automatically?

      Thanks in advance Moz community for your feedback.

      1 Reply Last reply Reply Quote 0
      • 94501
        94501 last edited by

        Hi Pete,

        It sounds like you've done what you can. I wouldn't submit multiple removals for the same url.

        I assume it's out of your site map and you're not still being hacked and have figured out how it happened and taken steps to fix it.

        Google will eventually figure it out. I'd try to move on to new stuff.

        Best... Mike

        peteboyd 1 Reply Last reply Reply Quote 0
        • peteboyd
          peteboyd @94501 last edited by

          Hi 94501,

          Thanks for taking the time to respond. Just to be clear, we are not submitting multiple removals for the same URL and I don't think Google WMT even allows you to do that. Completely new URLs are appearing each day after removing the older ones.

          My main concern is having spammy URLs indexed and associated with my website and the negative effects it can have from an SEO perspective.

          1 Reply Last reply Reply Quote 0
          • 94501
            94501 last edited by

            Sorry to misunderstand the problem. Do those new urls actually exist on your site or just in search?

            peteboyd 1 Reply Last reply Reply Quote 0
            • peteboyd
              peteboyd @94501 last edited by

              No problem at all! These new URLs do not actually exist on the website. Since we cleaned up the malicious code all of these URLs redirect to our 404 page.

              1 Reply Last reply Reply Quote 0
              • LesleyPaone
                LesleyPaone last edited by

                You might get a little quicker removal if you send them with a 410 status code. That will let Google know that the page is gone for good. http://searchenginewatch.com/sew/how-to/2340728/matt-cutts-on-how-google-handles-404-410-status-codes

                1 Reply Last reply Reply Quote 2
                • Dezzign
                  Dezzign last edited by

                  If the urls follow any particular pattern then you can use a  htaccess redirect and return the header code 410 / 403 / 404 to Google. (I suggest 410) They will soon drop out of the index.

                  I don't know the exact .htaccess syntax off the top of my head but it will be something like this:

                  If they all come from the same folder then it would look something like this:
                  RedirectMatch 410 ^/folder/.*$

                  If they have a common character string after the forward slash (such as xyz) then it would look something like this:
                  RedirectMatch 410 ^/xyz.*$

                  If they have any common character string footprints at all (such as xyz) then it would look something like this (now I'm guessing):
                  RedirectMatch 410 ^/()xyz.$

                  This would be a pretty easy fix if all of those spammy urls have any common characters after the forward slash or they all originate from a certain folder.

                  1 Reply Last reply Reply Quote 1
                  • 1 / 1
                  • First post
                    Last post
                  • How to get a large number of urls out of Google's Index when there are no pages to noindex tag?
                    effectdigital
                    effectdigital
                    0
                    2
                    50

                  • A client rebranded a few years ago and doesn't want to be associated with it's old brand name. He wishes not to appear when the old brand is searched in Google, is there something we can do?
                    0
                    1
                    28

                  • Google's 'related:' operator
                    EpicWebStudios
                    EpicWebStudios
                    0
                    5
                    209

                  • Some site's links look different on google search. For example Games.com › Flash games › Decoration games How can we do our url's like this?
                    davebuts
                    davebuts
                    0
                    4
                    268

                  • Removing content from Google's Indexes
                    Andy.Drinkwater
                    Andy.Drinkwater
                    0
                    6
                    263

                  • Is there any negative SEO effect of having comma's in URL's?
                    gcdtechnologies
                    gcdtechnologies
                    0
                    3
                    2.6k

                  • Best solution to get mass URl's out the SE's index
                    James77
                    James77
                    0
                    3
                    583

                  • Export list of urls in google's index?
                    nicole.healthline
                    nicole.healthline
                    0
                    3
                    2.6k

                  Get started with Moz Pro!

                  Unlock the power of advanced SEO tools and data-driven insights.

                  Start my free trial
                  Products
                  • Moz Pro
                  • Moz Local
                  • Moz API
                  • Moz Data
                  • STAT
                  • Product Updates
                  Moz Solutions
                  • SMB Solutions
                  • Agency Solutions
                  • Enterprise Solutions
                  • Digital Marketers
                  Free SEO Tools
                  • Domain Authority Checker
                  • Link Explorer
                  • Keyword Explorer
                  • Competitive Research
                  • Brand Authority Checker
                  • Local Citation Checker
                  • MozBar Extension
                  • MozCast
                  Resources
                  • Blog
                  • SEO Learning Center
                  • Help Hub
                  • Beginner's Guide to SEO
                  • How-to Guides
                  • Moz Academy
                  • API Docs
                  About Moz
                  • About
                  • Team
                  • Careers
                  • Contact
                  Why Moz
                  • Case Studies
                  • Testimonials
                  Get Involved
                  • Become an Affiliate
                  • MozCon
                  • Webinars
                  • Practical Marketer Series
                  • MozPod
                  Connect with us

                  Contact the Help team

                  Join our newsletter
                  Moz logo
                  © 2021 - 2026 SEOMoz, Inc., a Ziff Davis company. All rights reserved. Moz is a registered trademark of SEOMoz, Inc.
                  • Accessibility
                  • Terms of Use
                  • Privacy