๐Ÿ“˜ Official Documentation

WDD Redirect Chain Fixer

Everything you need to install, configure, and get the most out of the plugin โ€” from adding your first redirect to auto-fixing chains.

Before: 2-hop chain After: Direct
/old-page
โ†’
/interim-page
โ†’
/new-page
|
/old-page
โ†’
/new-page
Version 1.0.0 WordPress 5.5+ GPL-2.0+ By Nasibul Alam
๐Ÿ”— The Problem

What Is a Redirect Chain?

A redirect chain happens when a visitor trying to reach URL A gets bounced through one or more intermediate URLs before finally landing at the destination. Each hop adds latency, wastes your crawl budget, and weakens the SEO value passed along the chain.

Visitor โ†’ /old-page โ†’ /interim-page โ†’ /new-page   โ† 2 hops (bad)
Visitor โ†’ /old-page โ†’ /new-page                   โ† 1 hop  (good)
โš ๏ธ

Google recommends keeping redirect chains to a single hop. Each additional hop can cause Googlebot to give up crawling a URL entirely, and real users experience noticeable page-load delays.

Common causes

  • A page was renamed twice without updating the original redirect
  • Migrating from HTTP to HTTPS on top of existing redirect rules
  • Adding www / non-www rules on top of slug-change redirects
  • Third-party plugins creating their own redirect layers
โœ…

WDD Redirect Chain Fixer detects these situations automatically and lets you fix every chain in one click โ€” replacing the multi-hop path with a single, direct redirect.

โšก Capabilities

Features

๐Ÿ”„

Redirect Manager

Create, edit, enable, disable, and delete 301/302/307/308 redirects from a clean admin table.

๐Ÿ”

Chain Scanner

Automatically detects redirect chains stored in your database and visualises each hop.

โœ…

One-Click Fix

Fix a single chain or all chains at once. The plugin updates the target URL directly โ€” no manual editing required.

๐ŸŒ

Live URL Checker

Enter any URL and trace every HTTP hop in real time. See status codes, intermediate URLs, and the final destination.

๐Ÿ“Š

Hit Tracking

Records how many times each redirect is triggered and when it was last accessed.

๐Ÿ›ก๏ธ

Secure by Default

Nonce-protected forms, capability checks, sanitised inputs, and no raw SQL exposed to end users.

๐Ÿš€ Getting Started

Installation

Install via WordPress admin (recommended)

  1. Upload the plugin zip

    Go to WordPress Admin โ†’ Plugins โ†’ Add New โ†’ Upload Plugin and select wdd-redirect-chain-fixer.zip.

  2. Activate the plugin

    Click Install Now, then Activate Plugin. The database table is created automatically on activation.

  3. Open the admin panel

    Find Redirect Fixer in the WordPress admin sidebar. You are ready to go.

Manual install via FTP

  1. Extract the zip

    Unzip wdd-redirect-chain-fixer.zip on your computer.

  2. Upload the folder

    Upload the entire wdd-redirect-chain-fixer/ folder to /wp-content/plugins/ on your server.

  3. Activate from WordPress

    Go to Plugins in your admin panel and click Activate next to WDD Redirect Chain Fixer.

File structure

wdd-redirect-chain-fixer/
โ”œโ”€โ”€ wdd-redirect-chain-fixer.php     โ† Main plugin file
โ”œโ”€โ”€ uninstall.php                    โ† Cleanup on deletion
โ”œโ”€โ”€ includes/
โ”‚   โ”œโ”€โ”€ class-wdd-rcf-activator.php
โ”‚   โ”œโ”€โ”€ class-wdd-rcf-deactivator.php
โ”‚   โ”œโ”€โ”€ class-wdd-rcf-database.php
โ”‚   โ”œโ”€โ”€ class-wdd-rcf-redirect-handler.php
โ”‚   โ””โ”€โ”€ class-wdd-rcf-chain-detector.php
โ””โ”€โ”€ admin/
    โ”œโ”€โ”€ class-wdd-rcf-admin.php
    โ”œโ”€โ”€ css/wdd-rcf-admin.css
    โ””โ”€โ”€ js/wdd-rcf-admin.js
๐Ÿ’ก

On activation the plugin creates a single database table โ€” wp_wdd_redirects โ€” and sets three default options. No other changes are made to your WordPress installation.

๐Ÿ“Š Tab 1

Dashboard

The Dashboard is your at-a-glance health check. Open it any time to see the state of your redirects and whether any chains need attention.

Stat cards

Four counters give you an instant snapshot:

CardWhat it shows
Total RedirectsEvery redirect rule in the database, active or not.
ActiveRules that are currently live and will fire for visitors.
Chains DetectedNumber of redirect rules whose target URL is itself another redirect's source. Highlighted in orange when non-zero.
Total HitsCumulative number of times all redirects have been triggered (requires hit tracking to be on in Settings).

Chain alert banner

When chains are detected, a yellow warning banner appears with two quick actions:

  • View & Fix Chains โ€” jumps to the Chain Scanner tab.
  • Auto-Fix All โ€” fixes every chain instantly from the Dashboard without needing to go anywhere else.

When no chains exist, the banner turns green and confirms that all your redirects are direct.

Quick actions

Four shortcut cards let you jump to any section of the plugin with a single click: Add New Redirect, View All Redirects, Scan for Chains, and Settings.

๐Ÿ”€ Tab 2

Managing Redirects

The Redirects tab lists every rule in your database. You can search, filter by status, and perform bulk actions from this single screen.

Adding a redirect

Click Add New (top-right of the Redirects tab) or go directly to the Add Redirect tab in the navigation.

Dashboard
Redirects
โž• Add Redirect
Chain Scanner
Settings
FieldRequiredNotes
Source URL Required The URL to redirect away from. Use a relative path like /old-page or a full URL. Relative paths are recommended for portability.
Target URL Required Where the visitor ends up. Can be relative or absolute. External URLs must start with https://.
Redirect Type Optional 301 (permanent, SEO-safe) is the default. Choose 302 for temporary redirects. 307 and 308 preserve the HTTP method.
Status Optional Toggle on to make the redirect live immediately. Toggle off to save it as inactive (it won't fire for visitors).
Notes Optional Internal memo โ€” why the redirect exists, when it should be removed, etc. Visible only in the admin.
๐Ÿ’ก

The plugin normalises source URLs automatically. If you enter Old-Page (without a leading slash) it becomes /old-page. Case sensitivity depends on your Settings.

Editing a redirect

Click the pencil icon (โœ๏ธ) in the Actions column of any redirect row. The Add Redirect form re-opens pre-filled with that rule's values. Change whatever you need and click Update Redirect.

Deleting a redirect

Click the trash icon (๐Ÿ—‘๏ธ) in the Actions column. A confirmation dialog appears before anything is removed. The deletion is permanent.

โš ๏ธ

Deleting a redirect does not add a redirect back to the old URL. If you delete a rule that real visitors still hit, they will receive a 404. Consider deactivating instead of deleting when you are unsure.

Bulk actions

Tick the checkbox at the top of the table to select all rows, or select individually. Then choose a bulk action from the dropdown and click Apply.

ActionWhat happens
ActivateSets all selected redirects to active. They go live immediately.
DeactivateSets all selected redirects to inactive. Visitors will no longer be redirected by these rules.
DeletePermanently removes all selected redirects. A confirmation is required.

Search & filter

Use the search box to find redirects by source or target URL. Use the Status dropdown to show only active or only inactive rules. Both filters can be combined. Click Clear to reset to the full list.

Inline status toggle

Each row in the table has a toggle switch in the Status column. Clicking it activates or deactivates that redirect instantly via AJAX โ€” no page reload required.

๐Ÿ” Tab 3

Chain Scanner

The Chain Scanner tab has two tools: a live URL checker and a database chain detector. Use them together to find and eliminate every redirect chain on your site.

URL Checker

Enter any public URL and click Check URL. The plugin makes a live HTTP request (without following redirects automatically) and traces each hop until it reaches the final destination.

The result panel shows:

  • Whether the URL has a redirect chain or responds directly
  • Each hop with its URL and HTTP status code
  • The final destination URL
  • A warning count of unnecessary hops when a chain is found
Status codeColourMeaning
200GreenFinal destination reached successfully.
301 / 308AmberPermanent redirect โ€” a hop in the chain.
302 / 307AmberTemporary redirect โ€” a hop in the chain.
4xx / 5xxRedError โ€” the chain leads somewhere broken.
๐Ÿ’ก

You can also press Enter in the URL field to trigger the check without clicking the button.

Fixing redirect chains

The lower section of the Chain Scanner lists every chain detected inside your redirect database. Each chain is displayed as a flow diagram:

Source URL  โ†’  Intermediate URL  โ†’  Final URL

For each chain you have two options:

ActionWhat it does
Fix (single chain) Updates that redirect rule's target URL to point directly at the final destination. The intermediate hop is removed. The chain item fades out of the list on success.
Edit Opens the redirect in the Add/Edit form so you can make manual changes before saving.
Fix All Chains Fixes every detected chain in one request, then reloads the page to show the updated state. A confirmation dialog is shown before anything changes.
โœ…

Fixing a chain does not delete the intermediate redirect rule. It only updates the source redirect to bypass the intermediate hop. You can clean up the now-unused intermediate rule afterwards from the Redirects tab.

โš™๏ธ Tab 4

Settings

SettingDefaultDescription
Default Redirect Type 301 The redirect type pre-selected when creating a new redirect. Can be overridden per redirect. 301 is recommended for SEO.
Track Hit Count On When enabled, each time a redirect fires the plugin increments its hit counter and records the timestamp. Disable to reduce database writes on very high-traffic sites.
Case-Sensitive URL Matching Off When off, /Old-Page and /old-page match the same redirect rule. When on, the URL must match exactly. Recommended: off.
โš ๏ธ

Changing Case-Sensitive URL Matching affects how new redirects are stored from that point forward. Existing redirects already stored in lowercase may not match if you switch the setting to case-sensitive mid-operation.

๐Ÿ› ๏ธ Technical

How It Works

Database table

The plugin creates a single custom table โ€” wp_wdd_redirects โ€” on activation. All redirect rules are stored here. The table has indexed columns on source_url and is_active for fast lookups on every page request.

wp_wdd_redirects
โ”œโ”€โ”€ id            bigint  PRIMARY KEY
โ”œโ”€โ”€ source_url    varchar(2000)  INDEXED
โ”œโ”€โ”€ target_url    varchar(2000)
โ”œโ”€โ”€ redirect_type smallint (301/302/307/308)
โ”œโ”€โ”€ hit_count     bigint
โ”œโ”€โ”€ last_accessed datetime
โ”œโ”€โ”€ is_active     tinyint  INDEXED
โ”œโ”€โ”€ notes         text
โ”œโ”€โ”€ created_at    datetime
โ””โ”€โ”€ updated_at    datetime

Redirect processing

The plugin hooks into WordPress at template_redirect (priority 1 โ€” very early) on the frontend. On every page request it:

  1. Extracts the request path from $_SERVER['REQUEST_URI']
  2. Queries the database for an active redirect matching that path
  3. If found โ€” fires wp_redirect() with the correct HTTP code and exits
  4. If not found โ€” WordPress continues loading normally

Trailing-slash variants are also checked automatically, so /page and /page/ both match.

Chain detection algorithm

Detection runs entirely in PHP with a single database read. It:

  1. Loads all active redirects into memory
  2. Builds a hash map keyed by source_url โ€” O(1) lookup per entry
  3. For each redirect, checks whether its target_url exists as a key in the map
  4. If it does, that redirect is part of a chain

The fix updates the target_url of the offending rule to point directly at the final destination, bypassing the intermediate hop in a single UPDATE query.

Compatibility

  • WP Rocket โ€” No output buffering. The redirect fires before any page content is generated, so caching plugins are never involved.
  • Elementor โ€” No conflict. The plugin only acts on URLs that match a redirect rule; Elementor-built pages are unaffected.
  • WooCommerce โ€” Compatible. Redirect rules can target WooCommerce product and category URLs.
  • Multisite โ€” Not tested. Use on single-site installs only in v1.0.0.
โ“ Help

FAQ

Will deleting the plugin remove my redirect data?

Yes โ€” if you delete the plugin through WordPress Admin โ†’ Plugins โ†’ Delete, the wp_wdd_redirects table and all plugin options are permanently removed by the included uninstall.php handler.

Simply deactivating the plugin (without deleting) leaves all data intact. Reactivating it restores full functionality.

My old redirects from another plugin are not listed. Why?

WDD Redirect Chain Fixer manages only the rules stored in its own wp_wdd_redirects table. Redirects created by other plugins (Redirection, Yoast, Rank Math, etc.) live in their own tables and are not imported automatically.

You would need to export those rules from the other plugin and re-enter them here, or keep both plugins active in parallel.

Does the plugin handle www / non-www or HTTPS redirects?

The plugin matches on the path portion of the URL (e.g. /old-page), not the full domain. www / non-www and HTTP / HTTPS normalisation should be handled at the server level (Nginx, Apache, or your CDN) before the request reaches WordPress.

The URL Checker says "something went wrong". What do I do?

This usually means one of these things:

  • The URL you entered is unreachable from your server (firewall, DNS issue, or the site is down)
  • The server does not respond to HEAD requests โ€” the plugin retries with a GET request automatically, but some servers block both
  • SSL certificate errors on the target URL (the plugin disables SSL verification to accommodate self-signed certs, but some hosts still reject the connection)

Try the URL in your browser first to confirm it is publicly reachable.

Can I redirect to an external domain?

Yes. Enter the full URL including the protocol in the Target URL field, e.g. https://otherdomain.com/new-page. The plugin will issue a proper 301 (or whichever type you choose) to the external URL.

Does fixing a chain delete the intermediate redirect rule?

No. Fixing a chain only updates the source redirect's target to jump straight to the final destination. The intermediate rule remains in your database untouched.

If that intermediate rule is no longer needed, you can delete it manually from the Redirects tab afterwards.

How do I update the plugin to a newer version?

Go to WordPress Admin โ†’ Plugins โ†’ Add New โ†’ Upload Plugin, upload the new zip, and choose "Replace current with uploaded" when prompted. Do not delete the plugin first โ€” that would trigger the uninstall handler and wipe your redirect data.

Is this compatible with page caching plugins?

Yes. The redirect fires at template_redirect priority 1 โ€” before WordPress begins rendering any page content. Caching plugins like WP Rocket never see these requests, so there is no conflict. The visitor is redirected before any cache layer is involved.

Need help or have a feature request?

Visit webdevdoer.com โ†’