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
- How to Check if a Page Exists by URL?
- How to allow hidden custom fields to be added from wp-admin/post.php?
- Pretty URL with add_query_var
- get_permalink returns default link
- Group Posts by First Letter of Title
- How to batch update post content with custom post meta value
- how to get permalink using sql
- Edit meta data does’t work with custom sql
- Post custom permalink results in 404 for archive page
- Custom post type single (permalink) throws a 404 error
- How do I get the slug of a custom taxonomy category of a post?
- What Defines What Category A Post Picks (if in multiple)
- Using radio button meta data from a custom meta box
- Custom post type permalinks breaking due to 3.1 bug fix
- How can a guest view the “Pending Review” Post?
- change default post archive page link
- PHP Notice error (when on 404 page)
- How to get posts by multiple post slugs? [duplicate]
- Define a name to the posts slug
- Automaticly add slug to posts
- How to permanently delete a post meta entry?
- Modify WP_Post before processing
- I would like to give special promotion for the first 100 posts in my blog? Can anyone tell me how to do that?
- Converting a dynamic piece of code using WordPress Loop into a static one using Post ID
- WordPress not opening posts with only numbers if permalink is post_name
- How can I sort posts by the date and a custom meta field?
- is there a way to show the the post title after the image?
- Get Meta Key Value While Saving Post
- Problem with permalink routing?
- Force the “Choose from the most used tags” meta box section to always be expanded
- Meta value does not save for scheduled posts
- Switch to page template when using post permalink
- How to compare two posts including their meta fields on a scalable base?
- Remove Custom Post Type Slug and add Custom Taxonomy to Permalink Structure?
- Is it possible to paste a link without tags and make it directly a link in a post?
- Retrieve post ID from “querying” URL
- When changing pages to posts, how do you set up 301 redirects for the page URLs?
- How to calculate the average of a post meta value(Numeric) of a specific author
- WordPress custom post type with folder structure in slug
- wpColorPicker – problem with implementation to post meta
- my post slug gets really long and I can’t change it
- Edit the post title from the frontend
- custom word in custom permalink structure
- Show custom post with custom categories with specific slug
- Updating permalink structure using ‘post_link’ filter results in 404 error for posts
- When WP_Query only returns 1 post, how do I automatically redirect to that post?
- post type slug vs page slug
- The loop starting at a certain ID
- Simple Custom Metabox Not Saving
- Standalone form does not post to the url when form fields are populated (otherwise it does)
- Change permalinks for posts & for custom post types
- How to bulk Update URLs to new values?
- SQL DELETE multiple post_meta on single and multi-sites
- 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?
- Does having category name in permalinks affect SEO when having a post in multiple categories?
- unable to display two post per page in wordpress front-page.php
- Automatically select template based on query string for New Posts
- Permalink structure for two seperate blogs
- Append a random string to a post permalink
- Precedence of page permalinks over woocommerce product category links?
- Creating Ordered Query using Meta_key
- Fixing the WP Post Object for Custom Route
- Best Way to detect unique posts in wp rest api
- Add a meta to a post submited from a frontend form
- All my posts don’t show, only the headline is displayed on the homepage
- How to change post template via url?
- Posts in Page – How to customize the URL?
- How to get only current images of a post
- Run function after post is updated
- Can’t seem to replicate permalink structure for localhost development site
- WordPress rewrite url help needed
- Permalink of some posts change
- Adding custom fields to the Quick Edit screen – puzzled about the column concept
- TCPDF and permalinks
- WordPress sub-posts and permalinks
- 301 Redirecting posts without %postid% (just %post_name%) in permalink to ones with %post_name%_%postid%
- Read more link not working [closed]
- NewsPaper WP Theme – Additional Related Posts Filter by Time (divTag composer)
- What effect can a large wp_post table have on overall site performance?
- Changes done in admin panel are taking time to reflect in the REST api responses
- How to make internal links creating plugin to respect ACF?