Skip to main content

How to Reduce Index Bloat Without Losing Rankings

· 9 min read
Indexation audit for large websites

You have a site with 400,000 URLs, roughly 9,000 of which have ever earned an impression, and a growing conviction that something has to go. The instinct is to delete the obvious waste. That instinct is how sites lose rankings they had spent years earning, because the visible-looking dead URL with three impressions a month is not necessarily the expensive one, and the tidy archive from 2016 may be quietly doing more work than the new landing page everyone is arguing about.

Cutting a large site down is not a deletion job. It is a sequencing job, and the sequence matters more than the volume. Done in the wrong order it is the single most damaging technical change most sites ever make. Done in the right order it is uneventful.

The order below assumes you can change server configuration or redirect rules. If you cannot, skip to the Shopify section, because the same sequence applies with one honest adjustment to how a retirement is expressed.

This is the order.

Step one: find out what is actually earning an index​

Nothing else matters until you know which URLs have value, because every later decision depends on it. Start with Search Console performance data over at least the last twelve months, not thirty days. A URL that earns impressions in March and none in June is still an asset you own, and a twelve-month view is the minimum that surfaces seasonal landing pages.

Pull three lists, separately:

  • URLs with impressions but no clicks. These are the ones most people are about to delete by mistake. Many are ranking on page three for a term that converts slowly.
  • URLs with clicks. Small in number, non-negotiable. Note them by hand so nothing later can quietly sweep them up.
  • URLs with neither impressions nor clicks, grouped by pattern. This is your candidate list, and it is the only list that should enter any deletion workflow.

Note also that most sites carry a long tail of URLs that Search Console has never reported on at all. Those are not indexed and not earning anything, but they are still discovered and crawled. They are cheap to remove from discovery and carry no ranking risk.

Step two: never touch a URL with impressions​

This is the rule that protects you, and it is not negotiable in the first pass.

A URL with impressions has demonstrated that Google chose to show it. A URL with no impressions has demonstrated nothing at all, which is not the same as being worthless. The two are easy to confuse because both look like "not getting traffic", and only one of them is actually a decision Google has already made.

The practical consequence: your first removal pass should only touch patterns where the inspection sample came back with no impressions and no clicks. If a pattern has mixed results, split it and only remove the branch that is measurably dead. If the pattern is heterogeneous, do not collapse it into one verdict at all, because you will end up deleting the half that was working.

Step three: choose the right exit for each URL​

There are three exits and only three. Picking the wrong one is the expensive mistake.

Redirect (301) where an equivalent exists. A filter combination, a sorted view, a paginated listing with a real page one, an old product superseded by a new SKU with the same intent. Send it to the closest genuine equivalent, not to the homepage. A redirect to the homepage is a signal that you have given up, and it transfers nothing useful.

Retire (410) where no equivalent exists. A discontinued product with no successor, a deleted article, a filtered view that was never a real page. A 410 says the resource is permanently gone and stops Google re-checking it. That is the correct, cheap answer.

Leave it alone when the URL has impressions, when you cannot name its equivalent, or when the pattern is small enough that the saving is not worth the release risk.

# .htaccess — Apache

# 1. Redirect parameter permutations to the clean variant
RewriteEngine On
RewriteCond %{QUERY_STRING} ^(.*)&sort=[^&]*&?(.*)$ [NC]
RewriteRule ^(.*)$ /%1?%2 [R=301,L]

# 2. Redirect an old SKU to its successor
Redirect 301 /products/old-sku-1044 /products/new-sku-2210

# 3. Retire URLs permanently with no successor
RedirectMatch 410 ^/products/discontinued-(.*)
RedirectMatch 410 ^/blog/2016/archive/(.*)
# nginx — a map block plus the location rules it feeds

map $arg_sort $sort_present {
default 0;
"~." 1;
}

map $arg_utm_source $utm_present {
default 0;
"~." 1;
}

server {
# Parameter permutations redirect to the clean URL
if ($sort_present) {
return 301 $scheme://$host$uri;
}
if ($utm_present) {
return 301 $scheme://$host$uri;
}

# Retired URLs return 410 rather than redirecting
location ~ ^/blog/2016/archive/ {
return 410;
}

location ~ ^/products/discontinued- {
return 410;
}
}

And the mapping file your developer or CDN can import:

from,to,status
/products/old-sku-1044,/products/new-sku-2210,301
/collections/shoes?sort=price-asc,/collections/shoes,301
/collections/shoes?page=2,/collections/shoes,301
/products/discontinued-8831,,410
/blog/2016/archive/march-roundup,,410
/help/designer-notes,,410

Keep that file as a record. Six months from now someone will ask why a URL that used to rank returns nothing, and the answer is in a commit rather than in someone's memory.

This is the step people skip, and it undoes their own work.

When you return a 410 for a URL, every internal link pointing at it becomes a broken link. That is fine for a single page. It is not fine when the template that generated the retired URLs also generates the links to them, because you have just made a category of internal link errors across the site at once, and you have removed the path by which Google would otherwise have discovered that the resource is gone.

So for each retired URL, do three things: remove the internal links that point to it, remove the template code that generates those links, and remove it from the navigation, the footer, the related-products block and any XML sitemap.

This is also why internal-link cleanup has to happen at the same time as the redirect, not later. A redirect fixes the destination. Only removing the links fixes the source.

For everything you prune rather than retire, the same rule applies in a different form. If a pattern is blocked in robots.txt to stop it being crawled, remember that robots.txt blocks crawling, not indexing. A URL Google already knows about can still appear in results as a bare link, and blocking it does not withdraw it. That is a control over discovery, not a removal.

Step five: leave your highest-impression URLs alone​

Messy does not mean wrong. The ten URLs with the most impressions on a large site are frequently the ugliest things on it: a long filter landing page, a paginated category, a dated seasonal hub with a query string in the path. They are also the reason the site earns anything at all.

Do not tidy these. Do not restructure them because they look inconsistent with the new design. If a URL needs a canonical or a redirect, that is a separate decision made on its own evidence, not part of a cleanup release.

The corollary is about your new pages too. If the cleanup coincides with a redesign, ship them separately. A site that changes its URL structure and its template in the same release makes it impossible to attribute whatever happens next.

Step six: re-measure, then re-measure again​

Re-measure on a schedule rather than on anxiety. Four to six weeks is the earliest useful read on a large site, because a 410 takes time to be re-crawled and the effect on the remaining index is not instant. Then again at three months, and again at six.

Watch for three things and nothing else:

  • Total indexed pages. Should fall by roughly the number you retired.
  • Impressions and clicks on the URLs you kept. Should be flat or slightly up. If they fall, something went wrong and the file is the place to look.
  • Crawl activity per day. Should fall too, and that is the point.

If indexed pages do not fall after six months, the likely explanation is internal links you did not find. Go back to step four.

Shopify cannot serve a 410​

If your store runs on Shopify, everything above needs one honest adjustment, and it is the kind that gets glossed over.

Shopify redirects are 301-only. It cannot return a 410 for you, through the admin or through any file you upload. So on Shopify, a "pruned" page is one you have hidden from sitemaps, from search indexing and from storefront search, while the page itself still returns 200 to anyone holding the URL.

That is a genuine improvement in indexation hygiene and it is not a retirement. Any report that tells you it sent pages to 410 on Shopify is wrong, and you should treat the rest of that report with corresponding caution. The rest of the sequence still applies: decide redirect versus leave, remove the internal links, and re-measure.

Where to start​

If you take one thing from this, make it step one. Get the twelve-month impression data per pattern before you decide anything, because every argument about what to delete collapses into arithmetic once that data exists.

If the site is large enough that pulling and grouping that data by pattern is a project in itself, start a free indexation audit. Connect the Search Console property read-only and the first crawl groups the URLs into patterns and reports each pattern's verdict with the number of URLs actually inspected attached to it. That is the artefact step one is trying to produce, and it tells you which of the three exits each pattern deserves before you commit a release.