The slug is saved on the wp_posts while custom fields are on the wp_posts_meta. If you want to make it like that you can use an action hook on save_post that will get the value of the custom fields and saves it as the post slug.
Here is the code
add_action('save_post', 'set_slug');
function set_slug($post_id){
$new_slug = get_post_meta($post_id,'custom-slug', true);
$post_args = array(
'ID' => $post_id,
'post_name' => $new_slug,
);
wp_update_post($post_args);
}
Related Posts:
- post_name is not stored until post is published… where should I store my slug until it goes live then?
- 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%
- Update all posts automatically when using post_meta
- 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
- Categories Listing and Highlighting current category item
- 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
- Echo author slug in post edit page
- How to check if post meta key exists or not in wordpress database
- Custom Post Types, slug, archive and SEO plugins
- Why can posts never have a number as the link?
- How to allow slashes in single posts when i click in the edit permalink button
- Does WP get all post_meta on POST page?
- Sanitizing `wp_editor();` Values for Database, Edit, and Display
- What Defines What Category A Post Picks (if in multiple)
- Custom post type permalinks breaking due to 3.1 bug fix
- Changing my permalink structure – will new layout conflict with existing page?
- How is WordPress manipulating the posts like there are folders?
- How to permanently delete a post meta entry?
- WordPress custom slug (endpoint) and compare all links
- Display post category in foreach loop with category link
- Changing Permalinks for Default Post type to reflect navigation
- How should I add links to other pages/posts from my post?
- Why WP_Query(‘showposts=5’) shows only 1 post?
- How can I sort posts by the date and a custom meta field?
- Get Meta Key Value While Saving Post
- Most liked page not displaying posts
- How to make number of blog posts a custom field?
- Using permalinks, category slugs, and tag slugs
- 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
- How to have posts have a parent in permalink like site.com/blog/postname
- How to compare two posts including their meta fields on a scalable base?
- List authors with the last post title and order by last post date
- Retrieve post ID from “querying” URL
- hiding permalink in admin if the user is subscriber
- Redirect to another page using contact form 7? [closed]
- How to automate featured posts number? [duplicate]
- When changing pages to posts, how do you set up 301 redirects for the page URLs?
- How to save meta checkbox WordPress
- WordPress custom post type with folder structure in slug
- wpColorPicker – problem with implementation to post meta
- Edit the post title from the frontend
- Update post meta within save_post action
- Show custom post with custom categories with specific slug
- Updating permalink structure using ‘post_link’ filter results in 404 error for posts
- Is there a way getting post fields using `transition_post_status`
- When WP_Query only returns 1 post, how do I automatically redirect to that post?
- Update value of a associative array with update_post_meta
- How to show 3 most recent/viewed posts in a special tiles on home page using wordpress?
- How to display only one category in a custom post type?
- Limiting the amount of posts retrieved by the loop
- Standalone form does not post to the url when form fields are populated (otherwise it does)
- Changing permalink of WordPress
- Set Default Post as Parent Child (Nested) Relation
- How can I add random alphabets in wordpress permalink posts structure
- Featured Images most often doesnt appear
- How to bulk Update URLs to new values?
- 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?
- WP posts using index.php instead of single.php
- How do I generate formatted permalinks as specified in backend options?
- Permalink base only for posts
- If I moved the location of my generic “posts” page, do I need to change the slugs for all of the individual posts?
- Precedence of page permalinks over woocommerce product category links?
- Best Way to detect unique posts in wp rest api
- Show posts between two Custom Fields date
- Ordering posts alphabetically by meta keys and title
- Use a custom post URL that is outside the blog root directory
- Where should get_post_meta() go to get $post->ID get_post_meta() is empty and $post->ID & get_the_id() are working
- Change link to permalink inside post content
- How to limit the number of results for all query_posts on mysite
- User driven content problems
- How to display subcategory articles in the category view?
- Change posts URL [duplicate]
- retrieve post slug by post_tags taxonomy
- Show all posts in category
- How can we pass a value from the_permalink() at WordPress?
- If meta_key exists then don’t select this post?
- Default post type doesn’t display in url
- Is there any point to using wp_unique_post_slug?
- How to change Permalinks only for Blogposts
- Permalink structure for two separate blogs
- Blog posts are not appearing as subs of Blog Page
- Site ‘Categories’: save an admin global setting with post metadata [closed]
- How to add paraent in Blog post URL in wordpress
- Change permalinks in posts via SQL