PHPackages                             automattic/rewrite-rules-inspector - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. automattic/rewrite-rules-inspector

ActiveWordpress-plugin[Utility &amp; Helpers](/categories/utility)

automattic/rewrite-rules-inspector
==================================

WordPress plugin to inspect your rewrite rules.

1.6.0(4mo ago)13645425GPL-2.0-or-laterPHPPHP &gt;=7.4CI passing

Since May 18Pushed 1mo ago117 watchersCompare

[ Source](https://github.com/Automattic/Rewrite-Rules-Inspector)[ Packagist](https://packagist.org/packages/automattic/rewrite-rules-inspector)[ Docs](https://wordpress.org/plugins/rewrite-rules-inspector/)[ RSS](/packages/automattic-rewrite-rules-inspector/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelog (10)Dependencies (7)Versions (10)Used By (0)

Rewrite Rules Inspector
=======================

[](#rewrite-rules-inspector)

Stable tag: 1.6.0
Requires at least: 6.4
Tested up to: 6.9
Requires PHP: 7.4
License: GPLv2 or later
Tags: rewrite rules, tools
Contributors: danielbachhuber, automattic, tmoorewp, garyj

A simple admin tool for inspecting rewrite rules.

Description
-----------

[](#description)

A simple WordPress admin tool for inspecting rewrite rules. View a listing of all your rewrite rules, see which rewrite rules match a given URL (and the priorities they match in), or filter by different sources of rewrite rules. Perform a soft flush of your rewrite rules to regenerate them.

[Developed on GitHub](https://github.com/Automattic/Rewrite-Rules-Inspector/) — pull requests are always welcome. Please leave feedback, questions, bug reports, and feature requests in the GitHub issues.

### Where to find it

[](#where-to-find-it)

Go to `Tools → Rewrite Rules` in the WordPress admin.

### URL Tester

[](#url-tester)

Quickly test any URL (or path) against your site's rewrite rules:

- See whether the URL would be a **404** or which rule would match first (the one WordPress uses).
- View the list of **all matching rules**, in match priority order.
- Inspect the **query variables** extracted from the match and the resulting **final query** WordPress would run.

Works with full URLs or paths and automatically handles sites installed in a subdirectory.

### Permastructs

[](#permastructs)

Browse a table of all **permastructs** that WordPress is aware of, including:

- **Name** — the permastruct key (e.g. for posts, taxonomies, authors).
- **Structure** — the permalink structure pattern used to generate rules.
- **Description** — a human-friendly summary of what the permastruct controls.

### Flush Rules

[](#flush-rules)

The "Flush Rules" button allows you to regenerate your site's rewrite rules. Here's exactly what happens when you click it:

#### What the Flush Rules Button Does

[](#what-the-flush-rules-button-does)

When you click the "Flush Rules" button, the following sequence occurs:

1. **Security Check**: The system verifies you have the proper permissions (`manage_options` capability) and validates the security nonce to prevent unauthorized access.
2. **Cache Clearing**: WordPress deletes the cached rewrite rules from the options cache using `wp_cache_delete('rewrite_rules', 'options')`.
3. **Rule Regeneration**: WordPress calls `flush_rewrite_rules(false)` to regenerate all rewrite rules based on:

    - Current permalink structure settings
    - Custom post types and taxonomies
    - Any custom rewrite rules added by themes or plugins
4. **Hook Execution**: The `rri_flush_rules` action hook is fired, allowing other plugins to perform additional cleanup or actions after the flush.
5. **Success Feedback**: You're redirected back to the Rewrite Rules Inspector page with a success message confirming the rules have been flushed.

#### When to Use Flush Rules

[](#when-to-use-flush-rules)

Use the "Flush Rules" button when:

- **Missing Rules**: You see rules marked as "missing" (red background) in the inspector
- **Custom URLs Not Working**: Your custom permalinks or post type URLs aren't working properly
- **After Plugin Changes**: You've activated/deactivated plugins that register custom rewrite rules
- **Permalink Structure Changes**: You've modified your site's permalink structure
- **Custom Post Type Issues**: New custom post types or taxonomies aren't generating proper URLs

#### Important Notes

[](#important-notes)

- **Soft Flush**: This performs a "soft" flush (using `flush_rewrite_rules(false)`), which is safer than a hard flush as it doesn't force regeneration of all rules unnecessarily.
- **Permissions Required**: Only users with `manage_options` capability can flush rules.
- **No Data Loss**: Flushing rules doesn't delete any content or settings, it only regenerates the URL routing rules.
- **Immediate Effect**: Changes take effect immediately after flushing.

Installation
------------

[](#installation)

### Install the plugin from within WordPress

[](#install-the-plugin-from-within-wordpress)

1. Visit the Plugins page from your WordPress dashboard and click "Add New" at the top of the page.
2. Search for "rewrite-rules-inspector" using the search bar on the right side.
3. Click "Install Now" to install the plugin.
4. After it's installed, click "Activate" to activate the plugin on your site.

### Install the plugin manually

[](#install-the-plugin-manually)

1. Download the plugin from WordPress.org or get the latest release from our [GitHub Releases page](https://github.com/automattic/Rewrite-Rules-Inspector/releases).
2. Unzip the downloaded archive.
3. Upload the entire `rewrite-rules-inspector` folder to your `/wp-content/plugins` directory.
4. Visit the Plugins page from your WordPress dashboard and look for the newly installed plugin.
5. Click "Activate" to activate the plugin on your site.

Screenshots
-----------

[](#screenshots)

1. See all of the rewrite rules and flush them or download them.
    [![The main screen showing the rewrite rules](.wordpress-org/screenshot-1.png)](.wordpress-org/screenshot-1.png)
2. Test a URL against the rules to see which one(s) would match, and the priority they would match in.
    [![Showing the URL test results](.wordpress-org/screenshot-2.png)](.wordpress-org/screenshot-2.png)
3. Limit rules and URL testing results down to specificrule sources.
    [![Showing the URL test results when no rules from that source match](.wordpress-org/screenshot-3.png)](.wordpress-org/screenshot-3.png)
4. See which permastructs WordPress knows about.
    [![Showing the permastructs table](.wordpress-org/screenshot-4.png)](.wordpress-org/screenshot-4.png)

Changelog
---------

[](#changelog)

See the [change log](https://github.com/automattic/Rewrite-Rules-Inspector/blob/master/CHANGELOG.md).

###  Health Score

54

—

FairBetter than 97% of packages

Maintenance90

Actively maintained with recent releases

Popularity31

Limited adoption so far

Community31

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 65.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~338 days

Recently: every ~423 days

Total

6

Last Release

123d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ba7751eebec0f74a4963e9a062f49e58222b97872bf193d95f0505f3df321d09?d=identicon)[GaryJones](/maintainers/GaryJones)

![](https://www.gravatar.com/avatar/7c5869ecbb8e0eac7e8b8e0f3cf7bdd8d5fcdc4abc10a72281872c53f8639d44?d=identicon)[automattic](/maintainers/automattic)

---

Top Contributors

[![GaryJones](https://avatars.githubusercontent.com/u/88371?v=4)](https://github.com/GaryJones "GaryJones (106 commits)")[![danielbachhuber](https://avatars.githubusercontent.com/u/36432?v=4)](https://github.com/danielbachhuber "danielbachhuber (27 commits)")[![david-binda](https://avatars.githubusercontent.com/u/3651036?v=4)](https://github.com/david-binda "david-binda (5 commits)")[![dbernar1](https://avatars.githubusercontent.com/u/396755?v=4)](https://github.com/dbernar1 "dbernar1 (4 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (4 commits)")[![emrikol](https://avatars.githubusercontent.com/u/3060583?v=4)](https://github.com/emrikol "emrikol (3 commits)")[![raamdev](https://avatars.githubusercontent.com/u/53005?v=4)](https://github.com/raamdev "raamdev (2 commits)")[![simonhampel](https://avatars.githubusercontent.com/u/443890?v=4)](https://github.com/simonhampel "simonhampel (1 commits)")[![sjinks](https://avatars.githubusercontent.com/u/7810770?v=4)](https://github.com/sjinks "sjinks (1 commits)")[![trepmal](https://avatars.githubusercontent.com/u/251183?v=4)](https://github.com/trepmal "trepmal (1 commits)")[![WPprodigy](https://avatars.githubusercontent.com/u/8536129?v=4)](https://github.com/WPprodigy "WPprodigy (1 commits)")[![JavierParra](https://avatars.githubusercontent.com/u/590253?v=4)](https://github.com/JavierParra "JavierParra (1 commits)")[![jeremyfelt](https://avatars.githubusercontent.com/u/286171?v=4)](https://github.com/jeremyfelt "jeremyfelt (1 commits)")[![machouinard](https://avatars.githubusercontent.com/u/740342?v=4)](https://github.com/machouinard "machouinard (1 commits)")[![nickdaugherty](https://avatars.githubusercontent.com/u/1103700?v=4)](https://github.com/nickdaugherty "nickdaugherty (1 commits)")[![philipjohn](https://avatars.githubusercontent.com/u/136342?v=4)](https://github.com/philipjohn "philipjohn (1 commits)")[![ramiy](https://avatars.githubusercontent.com/u/576623?v=4)](https://github.com/ramiy "ramiy (1 commits)")

---

Tags

wordpresswordpress-pluginwpvip-plugin

###  Code Quality

TestsPHPUnit

Static AnalysisRector

### Embed Badge

![Health badge](/badges/automattic-rewrite-rules-inspector/health.svg)

```
[![Health](https://phpackages.com/badges/automattic-rewrite-rules-inspector/health.svg)](https://phpackages.com/packages/automattic-rewrite-rules-inspector)
```

###  Alternatives

[rainlab/blog-plugin

Blog plugin for October CMS

17257.7k](/packages/rainlab-blog-plugin)[rainlab/builder-plugin

Builder plugin for October CMS

17147.2k1](/packages/rainlab-builder-plugin)[pfefferle/wordpress-activitypub

The ActivityPub protocol is a decentralized social networking protocol based upon the ActivityStreams 2.0 data format.

5671.4k1](/packages/pfefferle-wordpress-activitypub)[civicrm/civicrm-drupal-8

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

18238.1k2](/packages/civicrm-civicrm-drupal-8)[mediawiki/semantic-glossary

A terminology markup extension with a Semantic MediaWiki back-end

1352.4k](/packages/mediawiki-semantic-glossary)[humanmade/lottie-lite

A lightweight Lottie Animations Extension for WordPress

374.3k](/packages/humanmade-lottie-lite)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
