{"id":18019,"date":"2012-05-09T21:24:09","date_gmt":"2012-05-09T21:24:09","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/rewrite-rules-inspector\/"},"modified":"2026-01-06T15:59:41","modified_gmt":"2026-01-06T15:59:41","slug":"rewrite-rules-inspector","status":"publish","type":"plugin","link":"https:\/\/twd.wordpress.org\/plugins\/rewrite-rules-inspector\/","author":5279457,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.6.0","stable_tag":"1.6.0","tested":"6.9.4","requires":"6.4","requires_php":"7.4","requires_plugins":null,"header_name":"Rewrite Rules Inspector","header_author":"Automattic, Daniel Bachhuber","header_description":"","assets_banners_color":"f2f3f3","last_updated":"2026-01-06 15:59:41","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"https:\/\/wordpress.org\/plugins\/rewrite-rules-inspector\/","header_author_uri":"https:\/\/automattic.com\/","rating":5,"author_block_rating":4.6842105263158,"active_installs":10000,"downloads":457840,"num_ratings":25,"support_threads":0,"support_threads_resolved":0,"author_block_count":6,"sections":["description","installation","changelog"],"tags":{"1.0":{"tag":"1.0","author":"danielbachhuber","date":"2012-05-09 21:24:09"},"1.1":{"tag":"1.1","author":"danielbachhuber","date":"2012-09-26 21:28:21"},"1.2":{"tag":"1.2","author":"danielbachhuber","date":"2013-01-16 22:07:55"},"1.2.1":{"tag":"1.2.1","author":"philipjohn","date":"2017-06-08 14:35:26"},"1.3.0":{"tag":"1.3.0","author":"automattic","date":"2021-05-18 19:09:28"},"1.3.1":{"tag":"1.3.1","author":"automattic","date":"2021-05-18 19:36:03"},"1.4.0":{"tag":"1.4.0","author":"automattic","date":"2024-05-21 09:32:38"},"1.5.0":{"tag":"1.5.0","author":"automattic","date":"2025-10-14 08:49:23"},"1.5.1":{"tag":"1.5.1","author":"automattic","date":"2025-10-14 16:09:46"},"1.6.0":{"tag":"1.6.0","author":"automattic","date":"2026-01-06 15:59:41"}},"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":1,"5":24},"assets_icons":[],"assets_banners":{"banner-1544x500.png":{"filename":"banner-1544x500.png","revision":3377946,"resolution":"1544x500","location":"assets","locale":""},"banner-772x250.png":{"filename":"banner-772x250.png","revision":3377946,"resolution":"772x250","location":"assets","locale":""}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0","1.1","1.2","1.2.1","1.3.0","1.3.1","1.4.0","1.5.0","1.5.1","1.6.0"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":3377946,"resolution":"1","location":"assets","locale":""},"screenshot-2.png":{"filename":"screenshot-2.png","revision":3377946,"resolution":"2","location":"assets","locale":""},"screenshot-3.png":{"filename":"screenshot-3.png","revision":3377946,"resolution":"3","location":"assets","locale":""},"screenshot-4.png":{"filename":"screenshot-4.png","revision":3377946,"resolution":"4","location":"assets","locale":""}},"screenshots":{"1":"<p>See all of the rewrite rules and flush them or download them.<br \/>\n<\/p>","2":"<p>Test a URL against the rules to see which one(s) would match, and the priority they would match in.<br \/>\n<\/p>","3":"<p>Limit rules and URL testing results down to specificrule sources.<br \/>\n<\/p>","4":"<p>See which permastructs WordPress knows about.<br \/>\n<\/p>"},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[12054,3972],"plugin_category":[59],"plugin_contributors":[77494,77514,78161,77579],"plugin_business_model":[],"class_list":["post-18019","plugin","type-plugin","status-publish","hentry","plugin_tags-rewrite-rules","plugin_tags-tools","plugin_category-utilities-and-tools","plugin_contributors-automattic","plugin_contributors-danielbachhuber","plugin_contributors-garyj","plugin_contributors-tmoorewp","plugin_committers-automattic","plugin_support_reps-garyj"],"banners":{"banner":"https:\/\/ps.w.org\/rewrite-rules-inspector\/assets\/banner-772x250.png?rev=3377946","banner_2x":"https:\/\/ps.w.org\/rewrite-rules-inspector\/assets\/banner-1544x500.png?rev=3377946","banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/rewrite-rules-inspector_f2f3f3.svg","icon_2x":false,"generated":true},"screenshots":[{"src":"https:\/\/ps.w.org\/rewrite-rules-inspector\/assets\/screenshot-1.png?rev=3377946","caption":"<p>See all of the rewrite rules and flush them or download them.<br \/>\n<\/p>"},{"src":"https:\/\/ps.w.org\/rewrite-rules-inspector\/assets\/screenshot-2.png?rev=3377946","caption":"<p>Test a URL against the rules to see which one(s) would match, and the priority they would match in.<br \/>\n<\/p>"},{"src":"https:\/\/ps.w.org\/rewrite-rules-inspector\/assets\/screenshot-3.png?rev=3377946","caption":"<p>Limit rules and URL testing results down to specificrule sources.<br \/>\n<\/p>"},{"src":"https:\/\/ps.w.org\/rewrite-rules-inspector\/assets\/screenshot-4.png?rev=3377946","caption":"<p>See which permastructs WordPress knows about.<br \/>\n<\/p>"}],"raw_content":"<!--section=description-->\n<p>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.<\/p>\n\n<p><a href=\"https:\/\/github.com\/Automattic\/Rewrite-Rules-Inspector\/\">Developed on GitHub<\/a> \u2014 pull requests are always welcome. Please leave feedback, questions, bug reports, and feature requests in the GitHub issues.<\/p>\n\n<h3>Where to find it<\/h3>\n\n<p>Go to <code>Tools \u2192 Rewrite Rules<\/code> in the WordPress admin.<\/p>\n\n<h3>URL Tester<\/h3>\n\n<p>Quickly test any URL (or path) against your site's rewrite rules:<\/p>\n\n<ul>\n<li>See whether the URL would be a <strong>404<\/strong> or which rule would match first (the one WordPress uses).<\/li>\n<li>View the list of <strong>all matching rules<\/strong>, in match priority order.<\/li>\n<li>Inspect the <strong>query variables<\/strong> extracted from the match and the resulting <strong>final query<\/strong> WordPress would run.<\/li>\n<\/ul>\n\n<p>Works with full URLs or paths and automatically handles sites installed in a subdirectory.<\/p>\n\n<h3>Permastructs<\/h3>\n\n<p>Browse a table of all <strong>permastructs<\/strong> that WordPress is aware of, including:<\/p>\n\n<ul>\n<li><strong>Name<\/strong> \u2014 the permastruct key (e.g. for posts, taxonomies, authors).<\/li>\n<li><strong>Structure<\/strong> \u2014 the permalink structure pattern used to generate rules.<\/li>\n<li><strong>Description<\/strong> \u2014 a human-friendly summary of what the permastruct controls.<\/li>\n<\/ul>\n\n<h3>Flush Rules<\/h3>\n\n<p>The \"Flush Rules\" button allows you to regenerate your site's rewrite rules. Here's exactly what happens when you click it:<\/p>\n\n<h4>What the Flush Rules Button Does<\/h4>\n\n<p>When you click the \"Flush Rules\" button, the following sequence occurs:<\/p>\n\n<ol>\n<li><p><strong>Security Check<\/strong>: The system verifies you have the proper permissions (<code>manage_options<\/code> capability) and validates the security nonce to prevent unauthorized access.<\/p><\/li>\n<li><p><strong>Cache Clearing<\/strong>: WordPress deletes the cached rewrite rules from the options cache using <code>wp_cache_delete('rewrite_rules', 'options')<\/code>.<\/p><\/li>\n<li><p><strong>Rule Regeneration<\/strong>: WordPress calls <code>flush_rewrite_rules(false)<\/code> to regenerate all rewrite rules based on:<\/p>\n\n<ul>\n<li>Current permalink structure settings<\/li>\n<li>Custom post types and taxonomies<\/li>\n<li>Any custom rewrite rules added by themes or plugins<\/li>\n<\/ul><\/li>\n<li><p><strong>Hook Execution<\/strong>: The <code>rri_flush_rules<\/code> action hook is fired, allowing other plugins to perform additional cleanup or actions after the flush.<\/p><\/li>\n<li><p><strong>Success Feedback<\/strong>: You're redirected back to the Rewrite Rules Inspector page with a success message confirming the rules have been flushed.<\/p><\/li>\n<\/ol>\n\n<h4>When to Use Flush Rules<\/h4>\n\n<p>Use the \"Flush Rules\" button when:<\/p>\n\n<ul>\n<li><strong>Missing Rules<\/strong>: You see rules marked as \"missing\" (red background) in the inspector<\/li>\n<li><strong>Custom URLs Not Working<\/strong>: Your custom permalinks or post type URLs aren't working properly<\/li>\n<li><strong>After Plugin Changes<\/strong>: You've activated\/deactivated plugins that register custom rewrite rules<\/li>\n<li><strong>Permalink Structure Changes<\/strong>: You've modified your site's permalink structure<\/li>\n<li><strong>Custom Post Type Issues<\/strong>: New custom post types or taxonomies aren't generating proper URLs<\/li>\n<\/ul>\n\n<h4>Important Notes<\/h4>\n\n<ul>\n<li><strong>Soft Flush<\/strong>: This performs a \"soft\" flush (using <code>flush_rewrite_rules(false)<\/code>), which is safer than a hard flush as it doesn't force regeneration of all rules unnecessarily.<\/li>\n<li><strong>Permissions Required<\/strong>: Only users with <code>manage_options<\/code> capability can flush rules.<\/li>\n<li><strong>No Data Loss<\/strong>: Flushing rules doesn't delete any content or settings, it only regenerates the URL routing rules.<\/li>\n<li><strong>Immediate Effect<\/strong>: Changes take effect immediately after flushing.<\/li>\n<\/ul>\n\n<!--section=installation-->\n<h3>Install the plugin from within WordPress<\/h3>\n\n<ol>\n<li>Visit the Plugins page from your WordPress dashboard and click \"Add New\" at the top of the page.<\/li>\n<li>Search for \"rewrite-rules-inspector\" using the search bar on the right side.<\/li>\n<li>Click \"Install Now\" to install the plugin.<\/li>\n<li>After it's installed, click \"Activate\" to activate the plugin on your site.<\/li>\n<\/ol>\n\n<h3>Install the plugin manually<\/h3>\n\n<ol>\n<li>Download the plugin from WordPress.org or get the latest release from our <a href=\"https:\/\/github.com\/automattic\/Rewrite-Rules-Inspector\/releases\">GitHub Releases page<\/a>.<\/li>\n<li>Unzip the downloaded archive.<\/li>\n<li>Upload the entire <code>rewrite-rules-inspector<\/code> folder to your <code>\/wp-content\/plugins<\/code> directory.<\/li>\n<li>Visit the Plugins page from your WordPress dashboard and look for the newly installed plugin.<\/li>\n<li>Click \"Activate\" to activate the plugin on your site.<\/li>\n<\/ol>\n\n<!--section=changelog-->\n<p>See the <a href=\"https:\/\/github.com\/automattic\/Rewrite-Rules-Inspector\/blob\/master\/CHANGELOG.md\">change log<\/a>.<\/p>","raw_excerpt":"A simple admin tool for inspecting rewrite rules.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/18019","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=18019"}],"author":[{"embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/automattic"}],"wp:attachment":[{"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=18019"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=18019"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=18019"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=18019"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=18019"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=18019"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}