Skip to content
WordPress.org
WordPress.org
Plugins
Themes
Patterns
Learn
Support
Documentation
Forums
News
About
Get Involved
Five for the Future
Showcase
Mobile
Hosting
Openverse
Get WordPress
Search
Get WordPress
Codex
Codex tools:
Log in
Interested in functions, hooks, classes, or methods? Check out the new
WordPress Code Reference
!
Template:Rewrite API
Articles
Lesson:
Rewrite API Overview
Class:
WP_Rewrite()
- An overview of WordPress's built-in URL rewrite class.
Hooks
Filter:
root_rewrite_rules
- Filters the rewrite rules generated for the root of your weblog.
Filter:
post_rewrite_rules
- Filters the rewrite rules generated for permalink URLs.
Filter:
page_rewrite_rules
- Filters the rewrite rules generated for your Pages.
Filter:
date_rewrite_rules
- Filters the rewrite rules generated for dated archive URLs.
Filter:
search_rewrite_rules
- Filters the rewrite rules generated for search URLs.
Filter:
comments_rewrite_rules
- Filters the rewrite rules generated for the latest comment feed URLs.
Filter:
author_rewrite_rules
- Filters the rewrite rules generated for author archive URLs.
Filter:
rewrite_rules_array
- Filters
all
the rewrite rules at once.
Filter:
{$permastruct}_rewrite_rules
- Can be used to create or modify rewrite rules for any custom permastructs, such as taxonomies or custom post types.
Action:
generate_rewrite_rules
- Runs
after
all the rules have been created.
Functions
add_rewrite_tag()
- Can be used to allow WordPress to recognize custom variables (particularly custom querystring variables).
add_rewrite_rule()
- Allows you to specify new, custom rewrite rules.
add_rewrite_endpoint()
- Add a new endpoint like /trackback/
flush_rules()
- Regenerate the rewrite rules and save them to the database.
flush_rewrite_rules()
- Remove rewrite rules and then recreate rewrite rules.
generate_rewrite_rules()
- Generates rewrite rules from a permalink structure
add_permastruct()
- Add a new permastruct
add_feed()
- Add a new feed type like /atom1/
Home Page
WordPress Lessons
Getting Started
Working with WordPress
Design and Layout
Advanced Topics
Troubleshooting
Developer Docs
About WordPress
Codex Resources
Community portal
Current events
Recent changes
Random page
Help