I am very new to WordPress. How can I use post custom metadata in place of Post Titles, and as the Post Permalink? For example, instead of domain.com/the-post-title, the permalink would be domain.com/$postcustommetadata.

I posted my idea in the WPORG support forums. I have a general idea, but don't know how to implement it, because I don't yet fully understand WordPress conventions, classes, etc.


Plzz HeLp

  • 2
    Please go back and rewrite your post in a way where you don't need to use uppercase (shouting) characters. This is for later readers too. Thanks.
    – kaiser
    Commented Oct 7, 2011 at 21:25
  • I don't understand the downvotes for the question? This sounds like a valid question. Perhaps the downvotes are due to the way the question is written? If so: consider that English may not be the OP's first language. :) Commented Oct 7, 2011 at 22:20
  • Please Someone help i found here very big wordpress coder and i think I can Get help from your side if you don't understand my idea i can explain it again more clearly please help out
    – realcoder
    Commented Oct 8, 2011 at 14:04
  • 2
    What you're asking for is a fairly advanced WordPress topic, and likely involves familiarity with the WordPress Rewrite API. Commented Oct 18, 2011 at 11:27
  • @ChipBennet removed downvote after edit.
    – kaiser
    Commented Oct 24, 2011 at 14:19

2 Answers 2


This will do.

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,


If you're looking for customizing the permalink for specific posts, pages or categories, try the Custom Permalinks plugin. I've had much success with it before.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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