add_rewrite_tag ( $tag, $regex, $query = '' )

  • (string) tag Name of the new rewrite tag.
  • (string) regex Regular expression to substitute the tag for in rewrite rules.
  • (string) query Optional. String to append to the rewritten query. Must end in '='. Default empty.
Defined at:


Adds a new rewrite tag (like %postname%).The `$query` parameter is optional. If it is omitted you must ensure that you call this on, or before, the {@see 'init'} hook. This is because `$query` defaults to `$tag=`, and for this to work a new query var has to be added.

Related Functions

add_rewrite_rule, add_rewrite_endpoint, remove_rewrite_tag, add_site_meta, iis7_add_rewrite_rule

Top Google Results

User discussions

wpseek mobile