Support » Plugin: Custom Post Type UI » Change page/post title to meta value or taxonomy

  • Resolved max817


    I run a ebook store. I have the custom post permalink plugin and your CPTUI to display my posts this way:
    Therefore I added a taxonomy to the permalink structure, like this:

    THe problem is, i want to show the title of the article as page title(the title you see above the browser window), but keep the article_id as permalink. Is it possible to get the page title from the post and insert it in the taxonomy name? Maybe I could get it from a meta value or another taxonomy, but i cant figure out how.
    If i change the taxonomy article_id name, i can keep the permalink, but i have about 1.000 posts.
    Thank you very much!

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Michael Beckwith


    The BenchPresser

    I think I’m going to need a bit more for concrete examples to mentally parse out what you’re requesting.

    For example:

    is “article” the post type slug you chose? with 2019_214 being perhaps the post title for a given post? Or is that a url mashup of say the year the post was published, and whatever 214 represents?

    Not sure if you’re using any SEO plugin, but if so, I imagine they’re tapping into the <title> output already. Otherwise, best advise would be to customize the title via the document_title_parts filter if you have title-tag theme support.

    Also not quite sure what you’re trying to do with regards to page title and taxonomy name. You should always be able to get a given title via something like this below, with $post_id being the ID of the post being rendered

    $mytitle = get_the_title( $post_id );

    Hi! Thank you for your fast answer!
    “article” is the custom post type and “2019_214” is the taxonomy term which is stored in the taxonomy “article_id”. Every ebook has a taxonomy with that information, so the permalink is created fine.
    Oh, I see now that AIOSEO detects the title correctly, but it isnt written in title! Now i have to dig in the seo plugin and replace the title in header with an AIOSEO command, right?
    Maybe the taxonomy is detected as taxonomy archive page… and i have to change the header in archive template?
    Thank you!

    Yippie, I found a solution!
    Wordpress passes the taxonomy directly. I had to make a rewrite and found this page for All in one SEO.
    Then i changed the code and now it works. Thank you for your efforts 🙂
    add_filter( ‘aioseop_title’, ‘dd_rewrite_custom_titles’ );
    function dd_rewrite_custom_titles( $title ) {
    if ( is_taxonomy(article_id) ) {
    $post_type = get_post_type_object( get_post_type() );
    $blog_title = get_bloginfo();
    $title = get_the_title( $post_id ) . ” | ” . $blog_title;
    return $title;

    Plugin Author Michael Beckwith


    The BenchPresser

    As long as it works and you’re getting the results you need, I’m happy 😀

    Let us know if you need anything else.

    Yes! Your plugin is great and your support is awesome. Keep up the good work!

    @max817 AIOSEOP dev here. Thank you for bringing this to our attention. Looks like we already have an issue for this here, but I’ve moved it up on our roadmap – Hopefully we can add support for custom post archives soon in one of our next releases.

    Plugin Author Michael Beckwith


    The BenchPresser

    thanks for chiming in with this @arnaudbroes 🙂

    @tw2113 pleasure. Keep up the good work with your awesome plugin – we use it often for testing. 🙂

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Change page/post title to meta value or taxonomy’ is closed to new replies.