When you use the graphical interface, post_name
is stored in the wp_posts
table even for draft posts as soon as you modify the default value.
I tried your code (case 2) and I actually see the new entry in the database, with the correct post_name
. Perhaps your check to post_name is not correct ?
Related Posts:
- Change slug with custom field
- Where is the old post permalink slug stored?
- Use category base slug in posts’ permalink
- How to automatically generate a unique random slug
- Post slugs and images cannot have same name?
- Change the Slug of Post Type post to baseurl/post/%postname%
- How to control which category will be picked for the slug of a post?
- Bulk update post slugs through database
- How to handle broken links created by permalink/slug changes?
- Visting slug for ‘post’ post type shows 404 not archive?
- how do i add posts-page slug before posts slug in permalinks
- Custom permalink for each post
- Private post caught in endless redirect loop
- How to 301 redirect from url with post id to permalink with post name (slug)?
- My post permalinks are always the same
- Custom Permalink Structure for Pages & Posts
- Change post author without using wp_update_post()
- if in category but only with post meta
- my post slug gets really long and I can’t change it
- Replace image name on upload to the new post name on front-end form
- Edit the post title from the frontend
- custom word in custom permalink structure
- wp_query with ajax
- Update post meta within save_post action
- Display post number by category
- Updating post meta for checkbox
- Saving Post Data in Another Database
- Show custom post with custom categories with specific slug
- register_post_type permalink
- Updating permalink structure using ‘post_link’ filter results in 404 error for posts
- Post is blank when I click on the link
- How can I tell if a post has been published at least once?
- Is there a way getting post fields using `transition_post_status`
- Automatic blog page with custom design [closed]
- Auto update post title and slug when post status is changed
- Add multiple meta keys to a post at once
- Show number of posts by logged in user
- How does WP decide how to display a page
- Unabled to Change Permalinks – Even Using the “Edit” (Resets to Original Permalink on “Update”)
- Post/page title to permalink transformation – what is behind the scenes?
- When sending a newsletter -not with wordpress- the server has 100% cpu [closed]
- Retrieve data from post meta meta_key having ‘_product_fq_image’ while having author_id and post type is PRODUCT
- Insert data from custom created PHP page into wp_postmeta table
- When WP_Query only returns 1 post, how do I automatically redirect to that post?
- post type slug vs page slug
- Adding a meta box to determine the sidebar [closed]
- The loop starting at a certain ID
- saving/reading custom field value does not work – no value gets POSTed
- Simple Custom Metabox Not Saving
- Post titles and thumbnails as links to custom post types?
- Internal linking to posts permalink fail because of spaces and stripe at postname
- Get post category as a separate string and url
- Link post images to post
- Making posts permalinks consistent numbers
- Can Permalink structure of %postname%/%post_id% improve performance
- How to link post titles on page A to its posts on page B?
- Problems with WordPress in subfolder, posts show a blank page
- how to create a sub section in posts
- Categories Listing and Highlighting current category item
- Standalone form does not post to the url when form fields are populated (otherwise it does)
- Changing permalink of WordPress
- Rewriting blog permalinks
- Set Default Post as Parent Child (Nested) Relation
- How can I add random alphabets in wordpress permalink posts structure
- Change permalinks for posts & for custom post types
- Remove subcategory slug from url
- Featured Images most often doesnt appear
- Can I show category name in url for only one of my categories?
- Post meta not working
- How to bulk Update URLs to new values?
- Select another post in a post meta like a parent page is selected while editing a page
- SQL DELETE multiple post_meta on single and multi-sites
- Permalink Short code showing unnecessary link text inside the loop
- Please help a newbie with blog page issue?
- Get post slug and match with menu item slug to change css
- My post permalinks are redirecting to the post archive page for some reason?
- How can I make a post sub link?
- How do you change the permalink for posts for a single category?
- How to retrieve all meta data directly from the $post object? Such as $post->related_topics?
- How to set the post permalink using the WordPress REST API?
- What is proper filter or hook action to add data to the $post object?
- Does having category name in permalinks affect SEO when having a post in multiple categories?
- WP posts using index.php instead of single.php
- How to add a ‘News’ section to specific posts in WordPress
- unable to display two post per page in wordpress front-page.php
- Add a url parameter to the current post and read it in a shortcode
- Blogposting Schema & Structured Data without plugin
- Automatically select template based on query string for New Posts
- Display Updated Date Instead of Published Date
- How can I set the permalink of an article / page equal to the permalink of an existing article / page?
- How do you update post date (year only) in a separate custom field?
- Add postmeta to all blog posts
- Prevent Archive URLs
- Custom Post Types and Broken Permalinks
- Bulk Post update_post_meta
- Re-order Category Meta-data
- Slug collision between page, taxonomy and custom post type
- Custom permalink for wordpress page / post
- Word /blog/ in slug post, problems in CPT. Solutions?
- Permalink structure for two seperate blogs