Yoast SEO
[resolved] [Plugin: WordPress SEO by Yoast] wp_title fallback if no posts exist (3 posts)

  1. magnumcreative
    Posted 3 years ago #

    If you have no posts in a custom posttype the page title for the archive page falls back to "blogname | tagline" even if you have set it to be specifically something in the Yoast settings.

    ie: if the posttype is an event type listing and there are no events (or posts yet) the title reverts back to default. So instead of the title saying "Events at My Company" which is set in Yoast it reverts back to "Blog Name } Tagline".

    What I want is the title for the archive page to consistently remain to what I've set it to and wondering if this could be added as an option to "force archives" to retain desired titles regardless of posts being present.


  2. magnumcreative
    Posted 3 years ago #

    This is what I eventually wrote in the head to solve my issue of titles not displaying on custom posttype archive pages.

        <?php if (is_post_type_archive('careers')) {
                echo 'Current careers available at '; bloginfo('name'); }
              elseif (is_post_type_archive('seminars')) {
                echo 'Upcoming broker education seminars at '; bloginfo('name'); }
              else { wp_title(''); }

    Ideally Yoast plugin would force the desired title regardless of a post being present in the custom postttype.

  3. magnumcreative
    Posted 3 years ago #

    Ironically its the same settings in Yoast, it just won't kick in unless I've published a post in to the custom posttype. The assumption of the call depends on published content, thus I had to customize the head title knowing the client may not having any content published due to the custom posttype being event/date based and they will expire and be deleted.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Yoast SEO
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic