---
url: 'https://metadrop.net/en/articles/how-to-fix-drupal-redirect-chains-automatically-with-redirect-audit'
title: 'How to fix Drupal redirect chains automatically with Redirect Audit'
author: 'Antonio Núñez'
date: '2026-09-17T07:50:40+00:00'
updated: '2026-10-09T11:45:02+00:00'
type: article
summary: 'Drupal sites accumulate redirect chains with every migration and content change; over time they reach hundreds or thousands, slowing navigation, hurting SEO, and becoming unfeasible to fix by hand. Redirect Audit is a Metadrop contrib module that audits every redirect, collapses chains to a single hop automatically, and flags loops for manual review. This article covers what the module fixes, how it does it, and the results measured on real sites.'
tags:
  - 'Drupal Planet'
  - Redirecciones
  - SEO/GEO/AEO
  - Performance
  - Drupal
image: 'https://metadrop.net/sites/default/files/styles/full/public/2026-09/redirect-audit-module.webp?itok=PMUzLtGD'
files:
  - 'https://metadrop.net/sites/default/files/2026-09/how-to-fix-drupal-redirect-chains-automatically-with-redirect-audit.pdf'
published: true
og:
  site_name: Metadrop
  'image:type': image/webp
  'image:width': '1295'
  'image:height': '740'
  'image:alt': 'How to fix Drupal redirect chains automatically with Redirect Audit'
  locale: en_US
  'locale:alternate': es_ES
schema:
  '@context': 'https://schema.org'
  '@graph':
    -
      '@type': Article
      '@id': 'https://metadrop.net/en/articles/how-to-fix-drupal-redirect-chains-automatically-with-redirect-audit#article'
      name: 'How to fix Drupal redirect chains automatically with Redirect Audit'
      headline: 'How to fix Drupal redirect chains automatically with Redirect Audit'
      description: 'Drupal sites accumulate redirect chains with every migration and content change; over time they reach hundreds or thousands, slowing navigation, hurting SEO, and becoming unfeasible to fix by hand. Redirect Audit is a Metadrop contrib module that audits every redirect, collapses chains to a single hop automatically, and flags loops for manual review. This article covers what the module fixes, how it does it, and the results measured on real sites.'
      about:
        - Redirects
        - SEO/GEO/AEO
        - Performance
        - Drupal
      image:
        '@type': ImageObject
        url: 'https://metadrop.net/sites/default/files/styles/full/public/2026-09/redirect-audit-module.webp?itok=PMUzLtGD'
        width: '1295'
        height: '740'
      datePublished: '2026-10-09T13:40:40+0200'
      dateModified: '2026-10-09T13:45:02+0200'
      author:
        '@type': Person
        name: 'Antonio Núñez'
      publisher:
        '@type': Organization
        '@id': 'https://metadrop.net/#organization'
      mainEntityOfPage: 'https://metadrop.net/en/articles/how-to-fix-drupal-redirect-chains-automatically-with-redirect-audit'
    -
      '@type': Organization
      '@id': 'https://metadrop.net/#organization'
      url: 'https://metadrop.net/'
      name: Metadrop
      sameAs:
        - 'https://www.drupal.org/metadrop'
        - 'https://x.com/metadrop'
        - 'https://asociaciondrupal.es/partner/metadrop'
        - 'https://www.linkedin.com/company/metadrop'
      telephone: '+34910053180'
      contactPoint:
        '@type': ContactPoint
        telephone: '+34910053180'
        email: hola@metadrop.net
        availableLanguage:
          - Spanish
          - English
        contactType: 'customer service'
      logo:
        '@type': ImageObject
        url: 'https://metadrop.net/modules/custom/metadrop_schema/images/logo-metadrop-500-500.jpg'
        width: '500'
        height: '500'
      address:
        '@type': PostalAddress
        streetAddress: 'Calle Virgen de Nuria 23'
        addressLocality: Madrid
        addressRegion: Madrid
        postalCode: '28027'
        addressCountry: ES
    -
      '@type': ItemPage
      '@id': 'https://metadrop.net/en/articles/how-to-fix-drupal-redirect-chains-automatically-with-redirect-audit'
      breadcrumb:
        '@type': BreadcrumbList
        itemListElement:
          -
            '@type': ListItem
            position: 1
            name: Home
            item: 'https://metadrop.net/en'
          -
            '@type': ListItem
            position: 2
            name: 'Expert Drupal & Tech Articles'
            item: 'https://metadrop.net/en/articles'
      publisher:
        '@type': Organization
        '@id': 'https://metadrop.net/#organization'
---
 1. [Articles](https://metadrop.net/en/articles)
 
  

# How to fix Drupal redirect chains automatically with Redirect Audit

Friday, October 09, 2026

 

 



Drupal sites accumulate redirect chains with every migration and content change; over time they reach hundreds or thousands, slowing navigation, hurting SEO, and becoming unfeasible to fix by hand. Redirect Audit is a Metadrop contrib module that audits every redirect, collapses chains to a single hop automatically, and flags loops for manual review. This article covers what the module fixes, how it does it, and the results measured on real sites.





   



During the lifecycle of a Drupal site, content changes and the site evolves, requiring content maintenance. One of the issues that can happen is redirect chains.



## Why Drupal sites accumulate hundreds of redirect chains

A Drupal site with many years of life, one or more migrations, or frequent content changes accumulates redirects automatically**. Every alias change and every moved page leaves one behind**, until there are hundreds or even thousands of them. A new project gets there too once content starts to be created, redirects added, and URLs moved.

The problem is silent. Nobody decides to create a redirect chain; chains appear when redirects pile up on top of each other over time. **Reviewing them manually is unfeasible** because of the time it would take, so they stay. **These situations usually surface in audits** run with different tools: until that moment they go unnoticed.

## Redirect chains and loops cost performance, SEO, and dead pages

A redirect chain is several hops in a row: `a → b → c → d`. **Each additional hop increases navigation latency** for users and makes crawling harder for search engines. Keeping every redirect at a single hop contributes to better SEO.

Googlebot follows up to 10 hops in a chain before giving up, but [**Google's official guidance**](https://developers.google.com/search/docs/crawling-indexing/site-move-with-url-changes) **is to redirect to the final destination directly** and, if that is not possible, to keep the chain under 3 to 5 hops. The 10-hop limit is the technical ceiling; the performance and SEO damage starts well before that.

A loop is worse. It appears when an already visited URL reappears in the path: `a → b → a`. The browser follows the redirects until it gives up and shows `ERR_TOO_MANY_REDIRECTS`, so the user never reaches the page.

  

 

## There are tools that detect redirect chains but they don't fix them

Tools like Lighthouse already detect redirect chains and flag them as a cause of slowness. Detection is a solved problem. **What none of these tools do is fix the chain**: going from several hops to a single one, taking each redirect directly from source to final destination. With hundreds of chains, that fix is exactly the part that matters.

**Redirect Audit was built to close that gap**. It depends on the Redirect contrib module, the foundation of redirect management in Drupal, and works on top of it as a completely independent module. It is compatible with Drupal 10, 11 and 12.

## Redirect Audit collapses chains to a single hop

The module detects the existing redirects, **analyzes the full path of each chain**, and categorizes each result as a chain or a loop.

For chains, it resolves the entire flow. A chain `a → b → c → d` generates the redirects `a → d`, `b → d`, `c → d`. **Every redirect points straight to the final destination, the intermediate hops are gone, and the original chain disappears**. The result is only direct, single-hop redirects.

  

 

## Edge cases: external URLs, long chains, and multilingual sites

Real sites bring three situations that need their own handling: chains that leave Drupal, chains longer than the analysis limit, and multilingual content.

### Chains that end in external URLs

Chains that end outside Drupal are handled too. The module makes no HTTP requests, so it cannot detect whether a destination returns a valid page, a 404 (a page that no longer exists) or any other error. An external URL is a valid destination that simply lives outside the site. The module treats it as the end of the chain, and the chain is still corrected: `a → b → c → external URL` becomes `a → external URL`, `b → external URL`, `c → external URL`. **The part of the chain that belongs to Drupal is optimized** even when the final destination is an external resource.

### Chains that exceed the max\_chain\_depth limit

The `<strong>max_chain_depth</strong>` **setting caps how many hops the analysis follows**, with a default of 10. The default was chosen for internal consistency with the rest of the module's processes, which are tuned to work within the resource constraints of any environment.

**A chain longer than the limit is not discarded**. It shows up truncated at the limit in the audit results, and nothing marks it as truncated: the final destination shown is the redirect at the limit, not the real end of the chain. Fixing it shortens the chain by up to the limit in one pass, and a new audit resolves what remains, so **successive audit and fix passes leave it fully clean**. However, in practice, chains over 10 hops are rare.

### Multilingual sites: false positives solved

Multilingual sites exposed a real edge case during development. Redirects between translations of the same node, for example from a Spanish alias to an English one, were first detected as chains or even loops. **Language was added to the analysis** and as a dashboard column, so each language is treated as an independent page and those false positives are gone.

## How it handles loops: flagged for a human, not auto-fixed

Loops are reported, and a warning is added to the Drupal Status Report so they stay visible. They are never fixed automatically: **programmatically there is no way to know what the correct final destination should be**, or which redirect is really meant to be kept. That decision belongs to each case.

The warning is purely informational. Leaving loops unfixed causes no errors and no logs; the site simply keeps the same loops it had. The dashboard's "Clear" button empties the table and hides the warning, which is useful when only loops remain in the results. It has no other function.

## Running it: Drush, dashboard, and cron

**Three Drush commands cover the basics**: `drush ras` scans, `drush raf` fixes, and `drush rai` shows all the information in detail.

The **dashboard covers everything outside the console**. It shows a table with the redirect type (loop or chain), the source language, the source alias, the intermediate redirects, and the final redirect, plus three buttons: Audit, Fix, and Clear.

 

 

As an advanced option, **cron can keep redirects optimized continuously** through automatic scanning of redirect changes and automatic corrections. Auto-correction only resolves chains, never loops, and ships disabled by default: the recommendation is to run a manual audit first and review the results before letting anything change redirects automatically.

Two settings control the resources involved. Batch Size defines how many redirects are analyzed per batch (default 50, range 1 to 500) to keep memory usage under control, and the dashboard page size defaults to 20 items (range 5 to 100).

 

 

## Real-world results on live sites

On a **site with 1,429 redirects, the audit completed in under 20 seconds**. On another **with 4,679 redirects, the audit took under 30 seconds** and detected 139 redirect chains and no loops; the fix then ran in under 10 seconds, faster than the audit itself. In both **projects, scanning plus correction stayed under 1 minute**.

The full first-time process, from reaching the project page to installing via Composer, enabling the module, scanning, and fixing from the dashboard, usually completes in under 2 minutes. On more limited resources these times could rise to an approximate maximum of 2 to 5 minutes for both processes. These are estimates, not fixed values, and all tests used the default configuration: batches of 50 redirects and a maximum of 10 hops per chain.

## Conclusion

Redirect chains are a well-known problem with plenty of detectors and almost no automatic fix. **Redirect Audit closes that gap: it fixes chains automatically in seconds**, collapsing every redirect to a single hop, and flags loops so a human can decide what each one should do. It fits three ways of working: a one-off cleanup, a **full audit of existing redirects, or continuous optimization through cron**.

Try it on your own site: the project page, with links to the repository and the README, is at [drupal.org/project/redirect\_audit](https://www.drupal.org/project/redirect_audit).



 [      Download how-to-fix-drupal-redirect-chains-automatically-with-redirect-audit (PDF, 783.93 KB)  ](https://metadrop.net/sites/default/files/2026-09/how-to-fix-drupal-redirect-chains-automatically-with-redirect-audit.pdf)

 

[Redirects](https://metadrop.net/en/articles?text=Redirects)

[SEO/GEO/AEO](https://metadrop.net/en/articles?text=SEO/GEO/AEO)

[Performance](https://metadrop.net/en/articles?text=Performance)

[Drupal](https://metadrop.net/en/articles?text=Drupal)

 

- Antonio Núñez
    
    Junior Developer
 
[Drupal SEO audit: crawl, indexation &amp; Core Web Vitals fixes](https://metadrop.net/en/services/drupal-audit/drupal-seo-audit " See Drupal SEO audit: crawl, indexation & Core Web Vitals fixes")

Metadrop's technical SEO audit traces crawl, indexation, schema, and Core Web Vitals problems to their Drupal root cause, then hands your team a prioritized fix roadmap.

 

 See more