Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I see that I can edit permalink information in wp-admin page > settings > permalinks. However, where is that information actually stored in the database?

share|improve this question
add comment

2 Answers

In the wp_options table there is a record where option_name = "permalink_structure".

However, the true, ultimate control of url rewriting is controlled by the WP_Rewrite API which saves/caches its information in the rewrite_rules wordpress option (also found in the wp_options table).

EDIT:

Also, when editing a page/post, you can change the "permalink" for that page/post (right below where you change the title). All that is doing is merely setting the post_name field for that page's/post's entry in wp_posts table (aka it's changing the "slug" for that page).

For all pages, it seems that the default rewrite rules are the following:

[(.?.+?)/page/?([0-9]{1,})/?$] => index.php?pagename=$matches[1]&paged=$matches[2]
[(.?.+?)/comment-page-([0-9]{1,})/?$] => index.php?pagename=$matches[1]&cpage=$matches[2]
[(.?.+?)(/[0-9]+)?/?$] => index.php?pagename=$matches[1]&page=$matches[2]

That list was obtained by me running this php code: echo nl2br('rules = '.print_r( $wp_rewrite->rules, true) . "\n");

There does not seem to be any builtin way to edit routing for pages since the permalink structure only applies to posts.

EDIT:

More random information I'm discovering: if your permalink_structure is an empty string (which is the "default" option you can choose), then wordpress completely skips all rewriting -- I'm really not sure why that's the case, but it is.

share|improve this answer
add comment

Permalink information is stored in wp_options.

Table name :- $wpdb->prefix'options'

And search option name like 'permalink_structure' in option table.

In that row in a table u can view the permalink structure.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.