undefined
Skip to content
Moz logo Menu open Menu close
  • Products
    • Moz Pro
    • Moz Pro Home
    • Moz Local
    • Moz Local Home
    • STAT
    • Moz API
    • Moz API Home
    • Compare SEO Products
    • Moz Data
  • Free SEO Tools
    • Domain Analysis
    • Keyword Explorer
    • Link Explorer
    • Competitive Research
    • MozBar
    • More Free SEO Tools
  • Learn SEO
    • Beginner's Guide to SEO
    • SEO Learning Center
    • Moz Academy
    • MozCon
    • Webinars, Whitepapers, & Guides
  • Blog
  • Why Moz
    • Digital Marketers
    • Agency Solutions
    • Enterprise Solutions
    • Small Business Solutions
    • The Moz Story
    • New Releases
  • Log in
  • Log out
  • Products
    • Moz Pro

      Your all-in-one suite of SEO essentials.

    • Moz Local

      Raise your local SEO visibility with complete local SEO management.

    • STAT

      SERP tracking and analytics for enterprise SEO experts.

    • Moz API

      Power your SEO with our index of over 44 trillion links.

    • Compare SEO Products

      See which Moz SEO solution best meets your business needs.

    • Moz Data

      Power your SEO strategy & AI models with custom data solutions.

    Let your reputation grow with Reviews AI
    Moz Local

    Let your reputation grow with Reviews AI

    Learn more
  • Free SEO Tools
    • Domain Analysis

      Get top competitive SEO metrics like DA, top pages and more.

    • Keyword Explorer

      Find traffic-driving keywords with our 1.25 billion+ keyword index.

    • Link Explorer

      Explore over 40 trillion links for powerful backlink data.

    • Competitive Research

      Uncover valuable insights on your organic search competitors.

    • MozBar

      See top SEO metrics for free as you browse the web.

    • More Free SEO Tools

      Explore all the free SEO tools Moz has to offer.

    NEW Keyword Suggestions by Topic
    Moz Pro

    NEW Keyword Suggestions by Topic

    Learn more
  • Learn SEO
    • Beginner's Guide to SEO

      The #1 most popular introduction to SEO, trusted by millions.

    • SEO Learning Center

      Broaden your knowledge with SEO resources for all skill levels.

    • On-Demand Webinars

      Learn modern SEO best practices from industry experts.

    • How-To Guides

      Step-by-step guides to search success from the authority on SEO.

    • Moz Academy

      Upskill and get certified with on-demand courses & certifications.

    • MozCon

      Save on Early Bird tickets and join us in London or New York City

    Unlock flexible pricing & new endpoints
    Moz API

    Unlock flexible pricing & new endpoints

    Find your plan
  • Blog
  • Why Moz
    • Digital Marketers

      Simplify SEO tasks to save time and grow your traffic.

    • Small Business Solutions

      Uncover insights to make smarter marketing decisions in less time.

    • Agency Solutions

      Earn & keep valuable clients with unparalleled data & insights.

    • Enterprise Solutions

      Gain a competitive edge in the ever-changing world of search.

    • The Moz Story

      Moz was the first & remains the most trusted SEO company.

    • New Releases

      Get the scoop on the latest and greatest from Moz.

    Surface actionable competitive intel
    New Feature

    Surface actionable competitive intel

    Learn More
  • Log in
    • Moz Pro
    • Moz Local
    • Moz Local Dashboard
    • Moz API
    • Moz API Dashboard
    • Moz Academy
  • Avatar
    • Moz Home
    • Notifications
    • Account & Billing
    • Manage Users
    • Community Profile
    • My Q&A
    • My Videos
    • Log Out

The Moz Q&A Forum

  • Forum
  • Questions
  • Users
  • Ask the Community

Welcome to the Q&A Forum

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

  1. Home
  2. SEO Tactics
  3. Intermediate & Advanced SEO
  4. URL Injection Hack - What to do with spammy URLs that keep appearing in Google's index?

Moz Q&A is closed.

After more than 13 years, and tens of thousands of questions, Moz Q&A closed on 12th December 2024. Whilst we’re not completely removing the content - many posts will still be possible to view - we have locked both new posts and new replies. More details here.

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

Intermediate & Advanced SEO
4
7
5.4k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as question
Log in to reply
This topic has been deleted. Only users with question management privileges can see it.
  • peteboyd
    peteboyd Subscriber last edited by Jun 26, 2015, 1:07 PM

    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
    • Dezzign
      Dezzign last edited by Jul 6, 2015, 10:11 AM Jun 28, 2015, 1:03 AM

      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
      • LesleyPaone
        LesleyPaone last edited by Jul 6, 2015, 10:11 AM Jun 26, 2015, 5:13 PM

        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
        • peteboyd
          peteboyd Subscriber @94501 last edited by Jun 26, 2015, 4:55 PM Jun 26, 2015, 4:55 PM

          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
          • 94501
            94501 last edited by Jun 26, 2015, 3:56 PM Jun 26, 2015, 3:56 PM

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

            peteboyd 1 Reply Last reply Jun 26, 2015, 4:55 PM Reply Quote 0
            • peteboyd
              peteboyd Subscriber @94501 last edited by Jun 26, 2015, 3:50 PM Jun 26, 2015, 3:50 PM

              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 Jun 26, 2015, 2:47 PM Jun 26, 2015, 2:46 PM

                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 Jun 26, 2015, 3:50 PM Reply Quote 0
                • 1 / 1
                1 out of 7
                • First post
                  1/7
                  Last post

                Got a burning SEO question?

                Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.


                Start my free trial


                Browse Questions

                Explore more categories

                • Moz Tools

                  Chat with the community about the Moz tools.

                • SEO Tactics

                  Discuss the SEO process with fellow marketers

                • Community

                  Discuss industry events, jobs, and news!

                • Digital Marketing

                  Chat about tactics outside of SEO

                • Research & Trends

                  Dive into research and trends in the search industry.

                • Support

                  Connect on product support and feature requests.

                • See all categories

                Related Questions

                • LindsayE

                  Can you index a Google doc?

                  We have updated and added completely new content to our state pages. Our old state content is sitting in a our Google drive. Can I make these public to get them indexed and provide a link back to our state pages? In theory it sounds like a great link building strategy... TIA!

                  Intermediate & Advanced SEO | Apr 18, 2018, 8:56 AM | LindsayE
                  1
                • andyheath

                  Magento: Should we disable old URL's or delete the page altogether

                  Our developer tells us that we have a lot of 404 pages that are being included in our sitemap and the reason for this is because we have put 301 redirects on the old pages to new pages. We're using Magento and our current process is to simply disable, which then makes it a a 404. We then redirect this page using a 301 redirect to a new relevant page. The reason for redirecting these pages is because the old pages are still being indexed in Google. I understand 404 pages will eventually drop out of Google's index, but was wondering if we were somehow preventing them dropping out of the index by redirecting the URL's, causing the 404 pages to be added to the sitemap. My questions are: 1. Could we simply delete the entire unwanted page, so that it returns a 404 and drops out of Google's index altogether? 2. Because the 404 pages are in the sitemap, does this mean they will continue to be indexed by Google?

                  Intermediate & Advanced SEO | Apr 29, 2016, 3:41 AM | andyheath
                  0
                • EcommRulz

                  Does Google Index URLs that are always 302 redirected

                  Hello community Due to the architecture of our site, we have a bunch of URLs that are 302 redirected to the same URL plus a query string appended to it. For example: www.example.com/hello.html is 302 redirected to www.example.com/hello.html?___store=abc The www.example.com/hello.html?___store=abc page also has a link canonical tag to www.example.com/hello.html In the above example, can www.example.com/hello.html every be Indexed, by google as I assume the googlebot will always be redirected to www.example.com/hello.html?___store=abc and will never see www.example.com/hello.html ? Thanks in advance for the help!

                  Intermediate & Advanced SEO | Nov 30, 2015, 10:53 PM | EcommRulz
                  0
                • _nitman

                  What's the best possible URL structure for a local search engine?

                  Hi Mozzers, I'm working at AskMe.com which is a local search engine in India i.e if you're standing somewhere & looking for the pizza joints nearby, we pick your current location and share the list of pizza outlets nearby along with ratings, reviews etc. about these outlets. Right now, our URL structure looks like www.askme.com/delhi/pizza-outlets for the city specific category pages (here, "Delhi" is the city name and "Pizza Outlets" is the category) and www.askme.com/delhi/pizza-outlets/in/saket for a category page in a particular area (here "Saket") in a city. The URL looks a little different if you're searching for something which is not a category (or not mapped to a category, in which case we 301 redirect you to the category page), it looks like www.askme.com/delhi/search/pizza-huts/in/saket if you're searching for pizza huts in Saket, Delhi as "pizza huts" is neither a category nor its mapped to any category. We're also dealing in ads & deals along with our very own e-commerce brand AskMeBazaar.com to make the better user experience and one stop shop for our customers. Now, we're working on URL restructure project and my question to you all SEO rockstars is, what can be the best possible URL structure we can have? Assume, we have kick-ass developers who can manage any given URL structure at backend.

                  Intermediate & Advanced SEO | Aug 8, 2015, 1:46 AM | _nitman
                  0
                • vivekrathore

                  "Null" appearing as top keyword in "Content Keywords" under Google index in Google Search Console

                  Hi, "Null" is appearing as top keyword in Google search console > Google Index > Content Keywords for our site http://goo.gl/cKaQ4K . We do not use "null" as keyword on site. We are not able to find why Google is treating "null" as a keyword for our site. Is anyone facing such issue. Thanks & Regards

                  Intermediate & Advanced SEO | Aug 4, 2015, 7:04 AM | vivekrathore
                  0
                • Kadel

                  Pipe ("|") in my website's title is being replaced with ":" in Google results

                  Hi , One of the websites I'm promoting and working on is www.pau-brasil.co.il.
                  It's wordpress-based website and as you can see the html's Title is "PauBrasil | some hebrew slogan".
                  (Screenshot: http://i.imgur.com/2f80EEY.gif)
                  When I'm searching for "PauBrasil" (Which is the brand's name) , one of the results google shows is "PauBrasil: Some Hebrew Slogan" (Screenshot: http://i.imgur.com/eJxNHrO.gif ) Why does the pipe is being replaced with ":" ?
                  And not just that , as you can see there's a "blank space" missing between the the ":" to the slogan.
                  (note: the websites has been indexed by google crawler at least 4 times so I find it hard to believe it can be the reason) I've keep on looking and found out that there's another page in that website with the exact same title
                  but when I'm looking for it in google , it shows the title as it really is , with pipe. ("|").
                  (Screenshot: http://i.imgur.com/dtsbZV2.gif) Have you ever encountered something like that?
                  Can it be that the duplicated title cause that weird "replacement"? Thanks in advance,
                  Kadel

                  Intermediate & Advanced SEO | Aug 23, 2013, 4:18 AM | Kadel
                  0
                • seoppc2012

                  Does Google index url with hashtags?

                  We are setting up some Jquery tabs in a page that will produce the same url with hashtags. For example: index.php#aboutus, index.php#ourguarantee, etc. We don't want that content to be crawled as we'd like to prevent duplicate content. Does Google normally crawl such urls or does it just ignore them? Thanks in advance.

                  Intermediate & Advanced SEO | Oct 16, 2013, 4:56 PM | seoppc2012
                  0
                • JamesO

                  To subnav or NOT to subnav... that's my question.... :)

                  We are working on a new website that is golf related and wondering about whether or not we should set up a subnavigation dropdown menu from the main menu. For example: GOLF PACKAGES
                    >> 2 Round Packages
                    >> 3 Round Packages
                    >> 4 Round Packages
                    >> 5 Round Packages GOLF COURSES
                    >> North End Courses
                    >> Central Courses
                    >> South End Courses This would actually be very beneficial to our users from a usability standpoint, BUT what about from an SEO standpoint? Is diverting all the link juice to these inner pages from the main site navigation harmful?  Should we just create a page for GOLF PACKAGES and break it down on that page?

                  Intermediate & Advanced SEO | Apr 25, 2011, 6:07 PM | JamesO
                  0

                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 - 2025 SEOMoz, Inc., a Ziff Davis company. All rights reserved. Moz is a registered trademark of SEOMoz, Inc.
                • Accessibility
                • Terms of Use
                • Privacy

                Looks like your connection to Moz was lost, please wait while we try to reconnect.