For the initiative adopt a tag I decided to adopt <url-rewriting>
and related tags.
I've started yesterday tasting the territory and, really, it's a mess.
I'm asking here to decide a rule I've to follow to make order in it.
Existing tags
Actually existing related tags are:
<url-rewriting>
(with synonym<rewrite>
)<rewrite-rules>
<mod-rewrite>
<add-rewrite-rule>
<rewrite-tag>
The first 2 tags, seems the most important to me, in particular I think that all the questions regarding WordPress way to handle url rewriting should be tagged <rewrite-rules>
(or maybe <rewrite-rules>
and <url-rewriting>
) and instead use <url-rewriting>
only for questions about non WordPress rewrite rules, just like the ones in .htaccess.
Regarding <mod-rewrite>
to me it seems an irrilevant tag, because it's too generic and less informative.
Last two tags, on the countrary, seems too narrow to me, I don't think it's useful tagging asnwers using specific function names, even because, just as example, a lot of questions using add_rewrite_rule
are answered using add_rewrite_endpoint
and so on...
Siblings tags
I noticed that when a question has <url-rewriting>
and related tags, very often there are also tags like <urls>
and/or <permalinks>
.
What to do with this tags? I'd like to follow same rule for all questions, so if we decide to leave where they are, I should also add where they don't are, on the countrary, I should remove them everywhere.
Sincerly I am for second alternative.
Another common sibling tag is <htaccess>
. I think this tag is ok when Q is about edit .htaccess file directly, should be removed anywhere else. In first case I think is better add the 2 tags <url-rewriting>
and <htaccess>
and remove <mod-rewrite>
Specific Cases
There a lot of questions regarding the url rewrite api of WordPress, but not involving rewrite rules directly a probably not comprehensive list is:
- questions about rewrite params of
register_post_type
andregister_taxonomy
- questions about removing/adding/editing permalink base for various archives
How properly tag these sort of questions? I thing <url-rewriting>
should be the right choice. Are these questions use cases for <urls>
and/or <permalinks>
tags?
Last my trouble regard questions asking something I call reverse rewrite, i.e. taking a pretty url and convert it in a url with query string, not necessarily the url the WordPress related one, e. g. take an url example.com/a-random-string/
and rewrite it in example.com/?foo=bar&bar=baz
.
The questions are various tagged, sometimes they have all possible tags: <url-rewriting>
, <htaccess>
, <mod-rewrite>
, <urls>
, and so on..
I've answered a couple of these questions suggesting a redirect instead of a rewrite rule, but in substance, which is the proper way to tags these questions?
Edit
After responses by @ChipBennett and @Rarst, in substance, what I suggest is:
- delete tags
<add-rewrite-rule>
,<rewrite-tag>
and<mod-rewrite>
- add a new tag
<rewrite-api>
as suggested by @ChipBennett, then make<rewrite-rules>
synonym to it - use
<rewrite-api>
for all questions regarding any function or hook of rewrite api and also for question regarding the 'rewrite' param of cpt/taxonomy registration - use
<url-rewriting>
for questions regarding rewrite rules not generated by WP. In these questions also use<.htaccess>
tag if relevant - Remove tags
<urls>
and<permalinks>
from from questions where only rewrite rules are involved - use
<rewrite-api>
also when questions are about to extract query vars from pretty permalinks (and remove<urls>
and<permalinks>
if present) - use
<urls>
when question are about convert a pretty url in a url with query vars not regarding WP e.g.mysite.com/a-page/
tomysite.com/myapp/my-file.php?myappvar=foo
[tag:tagname]
for automagically linked tags in posts.<url-rewriting>
for questions regarding rewrite rules not generated by WP" - would such questions be in-scope for WPSE?