How to 404 Spam Links to /1000 And Other Fake Pages

Updated 02/27/2025, Posted 02/27/2025 by James Parsons James Parsons 0 Comments

If you're in the same group of websites that I'm apparently in, then you're probably getting hit with spam links to URLs ending in /1000. And you've undoubtedly seen a bunch of new warnings in the "Redirects" section of Google Search Console:

Spam

What's happening is spam sites are linking to real pages on your site - but for whatever reason, they're adding /1000 to the end of those URLs. For example:

  • https://www.contentpowered.com/blog/best-structure-blog-post/1000

WordPress assumes that this is an error because that page doesn't exist, and with its redirect_canonical feature, it automatically redirects the visitor back to the parent post:

  • https://www.contentpowered.com/blog/best-structure-blog-post

Google sees this happening and is letting you know that "Hey, because this spam site is linking to a page on your site that immediately redirected to a different page, so we can't index these /1000 pages... just in-case you wanted us to for some reason...".

Well, we don't want them to index it!

I know what you are thinking. This sounds harmless right? Isn't redirecting these better for user experience in-case someone happens upon those spam links?

I had this same thought, and in many cases you'd be right - but in this case: not necessarily. When you redirect them, it can actually send the wrong signal to Google. Remember, these are spam sites linking to thousands of pages that don't exist:

  • If you redirect them, it could tell Google that, "Yes, I acknowledge that these exist, and now we want to funnel these spam backlinks somewhere else."
  • A 404 says "I don't know what this is because I never created that URL."

Which sends a stronger message against those spam links? Negative SEO is already something we have to worry about, so let's not try to confuse Google even more by attempting to capture this spam traffic.

So what do we do? We have to add some custom code to your site to fix it so that they instead show a "404 Not Found", especially since these are from spam sites.

Simply plop this code into the bottom of your functions.php file in your theme:

Note: Due to the complex nature of WordPress Plugins and custom code, you may have to adapt this code to work for you. If you have custom .htaccess code, it may write over your URLs anyway, or a WordPress plugin may load earlier or at a higher priority. For the vast majority of WordPress sites, this works perfectly. If you have lots of custom code and if this doesn't work, I recommend reviewing your 301 redirect plugins, your .htaccess file, and your functions.php file for conflicting rewrite rules.

// Force a 404 page on specific URL suffixes that spam sites are linking to

add_filter( 'redirect_canonical', 'disable_canonical_for_custom_endpoints', 10, 2 );
function disable_canonical_for_custom_endpoints( $redirect_url, $requested_url ) {
if ( preg_match( '#/(?:1000|undefined|null)/?$#', $requested_url ) ) {
return false;
}
return $redirect_url;
}

(I had other spam links and redirects in GSC pointing to things like "/undefined", "/null" and so on, so you may want to keep those in the code or add any other patterns that you're seeing in your Search Console dashboard.)

Additionally, since WordPress may still redirect URLs that don't contain a trailing slash (e.g. automatically redirecting from /1000 to /1000/), you may have to modify your .htaccess file to prevent this. Your server might think that /1000 is a directory and try to add the trailing slash automatically to /1000/. Unfortunately this also counts as a redirect. Remember, the entire goal here is to keep it out of your "Redirects" section in GSC and for it to show a 404, not a 301 to a 404. So we need both /1000 and /1000/ to show a 404, without any redirects inbetween. Still with me?

If your blog posts are adding a trailing slash after URLs when you add /1000 after them (and you've already cleared your cache and verified your browser didn't cache the original redirect), then you can try to add these two lines in your .htaccess after the "RewriteEngine On" line:

# Exclude any URL ending with "/1000" or "/1000/" from being redirected
RewriteCond %{REQUEST_URI} (?:^|/)1000/?$ [NC]
RewriteRule ^ - [L]

Now it'll take any of these URLs and override WordPress's default functionality so that instead of redirecting them, it will trigger a "404 Not Found" so Google knows that they don't exist. Both the /1000 and /1000/ URLs will show a steady 404 error, without any 301 redirects inbetween, and these will start to drop from Search Console over time. Be patient as this can take up to a few months.

Did this help you? Do you have any questions? Please let me know in the comments!

Related Code Snippets

Written by James Parsons

Hi, I'm James Parsons! I founded Content Powered, a content marketing agency where I partner with businesses to help them grow through strategic content. With nearly twenty years of SEO and content marketing experience, I've had the joy of helping companies connect with their audiences in meaningful ways. I started my journey by building and growing several successful eCommerce companies solely through content marketing, and I love to share what I've learned along the way. You'll find my thoughts and insights in publications like Search Engine Watch, Search Engine Journal, Forbes, Entrepreneur, and Inc, among others. I've been fortunate to work with wonderful clients ranging from growing businesses to Fortune 500 companies like eBay and Expedia, and helping them shape their content strategies. My focus is on creating optimized content that resonates and converts. I'd love to connect – the best way to contact me is by scheduling a call or by email.