• Resolved Guaven Labs

    (@elvinhaci)


    In wp-meta-seo.php you have a function called wpmstitle.

    It has such a block for taxonomy terms.

    if (is_category() || is_tag() || is_tax()) {
        if (function_exists('get_term_meta')) {
            $meta_title = get_term_meta($term->term_id, 'wpms_category_metatitle', true);
        } else {
            $meta_title = get_metadata('term', $term->term_id, 'wpms_category_metatitle', true);
        }
        $meta_title = $opengraph->replaceSnippet($meta_title, null);
    }

    As you can see here, if “wpms_category_metatitle” term is empty for any category, then it will cause empty
    <title></title>
    in header.php.

    Please have a look.

    • This topic was modified 3 years, 8 months ago by Guaven Labs.
    • This topic was modified 3 years, 8 months ago by Guaven Labs.
Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author JoomUnited

    (@joomunited)

    Thanks for your feedback, we’ll check that right away.

    Cheers,

    Plugin Author JoomUnited

    (@joomunited)

    Hi,

    I just run some test and I think that’s a conflict with something else on your website.
    Usually WP Meta SEO is using the custom category title, if defined, if it’s not defined you should have by default: “Category name – Website name”

    Do you have any other SEO plugin or something that may create interfere with that? Also, do you have URL of a post category and of a custom post category from another plugin?

    Thanks.

    Thread Starter Guaven Labs

    (@elvinhaci)

    no, i don’t use any other SEO plugin.
    In my website wp_title is being called only by wpmstitle function.
    (i debugged it)

    The code i shared with you clearly tells that wpmstitle returns wpms_category_metatitle term meta. It doesn’t use default title if it is category page.
    Please check wpmstitle() function yourself and you will see that your code doesn’t contain any string related to default title.
    It returns wpms_category_metatitle meta even when that meta is empty.
    Please, just check the code of wpmstitle.

    I think you just need to do this.

    In 746th line of wp-meta-seo.php put

    if(empty($meta_title))$meta_title=$title;

    before

    return esc_html($meta_title);

    That will restore default title when meta_title is empty.

    Plugin Author JoomUnited

    (@joomunited)

    Hi,

    I’ve made the developer look into this and it seems that wpmstitle() function can return an empty title in this case, but: after we run wpmstitle() function, we run also wpmsopengraph() function.

    And because wp_head hook run after wp_title hook, in wpmsopengraph() function, we have set default for title.

    Cheers,

    Thread Starter Guaven Labs

    (@elvinhaci)

    Now it seems clear.

    Please note that there are a lot of themes that don’t use this

    add_theme_support( 'title-tag' );

    but instead use title tag directly inside header.php(before wp_head)

    And for those cases your code will always return empty.

    I hope you will add some solution for this case.

    Plugin Author JoomUnited

    (@joomunited)

    Hi,

    OK I see now, this is clear. We’ll plan to include a workaround to that that works with all the plugin features in the next release.

    Cheers, thanks!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Empty title tags for terms’ is closed to new replies.