Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What columns stores the slug in wordpress

Tags:

In wordpress, what column stores the slug (either auto generated, or user entered)?

I can not find this in either wp_posts or wp_postmeta. The wp_posts GUID stores a direct link, but not the slug.

like image 221
agiliq Avatar asked Jan 16 '10 15:01

agiliq


People also ask

What is slug category in WordPress?

In WordPress, a slug is the bit of text that appears after your domain name in the URL of a page. Essentially, it's the part of your site's URL that identifies every single page on your site (except for the homepage). For example, on this glossary entry, it's “wordpress-slug”.

How do I edit a slug in WordPress?

Go to Posts and choose Tags. Find the tags you want to edit and click the Edit button. After you input your tag slug, click Update to save the change.

What is slug in WordPress example?

In WordPress, the “slug” refers to the part of a web page's address that appears after the domain name. A simple WordPress slug example would be if you visited a blog post at www.example.com/blog-post, then “www.example.com” is the domain name, and “blog-post” is the post slug.

Why can I change the slug WordPress?

It's because that slug is used by your Home page. To fix this you need to change the Home page slug to home (or anything else). This will free the blog slug and you'll be able to use on the Blog.


2 Answers

The slug for Posts and Pages are stored in the wp_posts posts table in the column post_name. Just be aware that all the automatic saves as well as attachments are stored in the same table, so there will not be a solid column full of slugs, but only one for each "parent" (parent to the revisions) Post or Page.

like image 89
Doug Neiner Avatar answered Sep 19 '22 11:09

Doug Neiner


At the risk of heresy, I am going to say it is not completely true. I was updating some slugs and found the post_name field does not change. On further searching, I found the wp_postmeta table has an entry under meta_key name 'custom_permalink' that has the latest slug path.

like image 20
Gordon Rouse Avatar answered Sep 21 '22 11:09

Gordon Rouse