• Resolved ct1601

    (@ct1601)


    Is there any way (a function maybe?) to prevent WordPress from generating title tags automatically?

    Since im using YOAST on a test site instead of my main site, i can not edit the title / meta tags through YOAST.

    Can you provide me a piece of code to prevent WordPress from creating title tags, so i can add them manually?

    Or some code to override the title tags?

    I found

    remove_action( 'wp_head', '_wp_render_title_tag', 1 );

    Which works nearly perfect but the catch is, that my website layout breaks while loading a page. Only when the page is fully loaded, the layout is shown properly.

    Because of that i need another solution or a fix.

    Hope you can help me out with that, many thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Maybellyne

    (@maybellyne)

    @ct1601

    Thanks for reaching out regarding your title tag. If I understand correctly, you have Yoast SEO on a test site and can’t edit the title tag. As such, you want to prevent WordPress from automatically generating one.

    Well, if you have Yoast SEO installed on a site, you should be able to edit/set a title tag. Is there an error you get when you try to do that?

    Thread Starter ct1601

    (@ct1601)

    Hi, thank you for your reply.

    The case is the following:

    YOAST is only active on my test site, since i do not want to have any plugins installed on my main site.

    With YOAST installed, i can easily edit the title tag through the YOAST settings.

    But as i stated before, im running YOAST only on my test site to optimize content before publishing on my main site.

    Now the problem im facing is:

    Whenever i create a blog post on my main site, the blog title gets automatically wrapped into a html title tag. And when i add my own custom title tag through the block editor, i end up with two title tags.

    1) the blog title which gets automatically wrapped into a html title tag by wordpress (or my theme?)

    2) the custom html title tag i added manually.

    So what im now trying to do is, prevent WordPress from automatically wrapping the blog titles into html title tags.

    or

    Override the title tag.

    Since YOAST obviously already has a function for exactly this task, i wanted to ask if you guys could help me out with that.

    By providing a php code maybe?

    I already read that you do not like to provide any code to prevent any possible bugs from occuring.

    But since my case is a bit different, i would gratefully accept any help at my own risk and i am aware of possible website errors.

    Hope you guys can help me out on that.

    Many thanks

    Hey @ct1601,

    Thank you for your reply!

    This is indeed default behavior and is somewhere located in your theme header.php file how it handles the title output. You may want to dive into your theme header.php and check if you can customize it/remove it from being output in a childtheme – or alternatively, you may want to look into the wp_title filter/function: https://developer.ww.wp.xz.cn/reference/functions/wp_title/

    However, this is indeed outside Yoast support as this is not Yoast SEO related. As you understand, we’ll mark the topic here as resolved to keep the overview. Thank you and good luck in customizing your site to your needs.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘WordPress generates automatically title-tag’ is closed to new replies.