# A tool to analyze rewrite rules? [closed]

Is there a good tool to analyze my rewrite rules? I always get confused with the regexes and the parameter replacements.

I have created something myself and will post it here so others can use it, but please feel free to add other tools!

-

## closed as off topic by Rarst♦Feb 22 '13 at 3:28

Questions on WordPress Development Stack Exchange are expected to relate to WordPress within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

I don't understand the analyse part. For what should this be good for in concrete? just to read rewrite rules? that's the only plugin I'm aware of so far: wordpress.org/extend/plugins/askapaches-rewriterules-viewer –  hakre Nov 4 '10 at 2:11
@hakre: Analyze and debug, in case you want to add a new rewrite rule but don't understand why it is not working. My current version for example also checks whether the query vars are read by WP::parse_request(). It is part of a larger effort to understand and maybe even improve the documentation of the rewrite engine. –  Jan Fabry Nov 4 '10 at 10:34
Denis named an interesting aspect here: wordpress.stackexchange.com/questions/3431/… -- number of rules per post / page. –  hakre Nov 5 '10 at 22:11

## 1 Answer

Well what a coincidence that you ask this, Jan! Just today I had time on a long train journey and decided to write a Rewrite Analyzer plugin, one that parses your rewrite rules and highlights the query variables. You can test URLs right there and see what query variables will be set.

You can find it in the plugin repository, or just as Monkeyman Rewrite Analyzer when search for new plugins in your administration screen.

-
Nice would be to have that as an addition to the debug bar :) –  kaiser Mar 21 '11 at 0:35
Is there an SVN the plugin can be pulled from? –  t31os Apr 13 '11 at 16:45
Question, Jan: when something is crossed out in red, what does that mean exactly? –  Manny Fleurmond Jun 24 '11 at 3:09
@Manny: Red query variables are not marked as public, so they will not be sent to the \$wp_query object and you will have a hard time accessing them later. –  Jan Fabry Jun 24 '11 at 11:13
Very useful! Thanks! I haven't totally gotten things working, but it's been a huge help so far. –  Rebecca Chernoff Aug 22 '11 at 21:54