[Resolved] title-tag empty on index

Home Forums Support [Resolved] title-tag empty on index

Home Forums Support title-tag empty on index

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #655571
    generator

    Hello,

    I realized suddenly my <title> on index-page is empty.
    But it’s there on subpages.

    A few days ago I deleted the Title in the settings tab, because I only wanted the page-title showing up as <title>
    But on that day everything worked fine, but now the whole title-tag is empty.

    Can you please help?
    The only other thing I did is, I updated a Elementor Addon by Livemesh, I already checked via deactivating it, it doesn’t solve the problem

    GP Premium 1.7.2
    #655907
    Leo
    Staff
    Customer Support

    Hi there,

    Is there a specific page or element I should be looking at?

    Keep in mind that if it’s something to do with Elementor then it’s best to ask their support πŸ™‚

    #656022
    generator

    Yes on the title tag of the home-page.
    (And because of that the home pages browser tab contains only the domain name, not the title I entered.)

    This is because the title tag on the home page (on the index.php) is empty, but there should actually be the title I entered in the wordpress-page-backend.
    The titles on subpages work correctly, they contain the title I entered in their pages.

    It can actually not be caused by Elementor because the page title comes from the ordinary wordpress-page-backend. I already checked that by deactivating their plugins.

    #656030
    Leo
    Staff
    Customer Support
    #656036
    generator

    No there is nothing entered, because I dont wanted it to appear in browser tab (and in search result title) as a second title behind the page title.
    But even IF I enter a title there, THIS title shows up but not the one I entered in the pages title field.

    This only happens on index page.

    I already found some other posts on the internet about this problem. Should I create a child of the index.php and enter these codes in the title-tag to fix it?
    But strange it happened just a little while ago, it worked fine all the time before.

    The mentioned links are:
    https://wordpress.stackexchange.com/questions/43619/empty-title-on-front-page-home
    https://pixert.com/blog/wordpress-title-empty-on-index-page/

    #656250
    Tom
    Lead Developer
    Lead Developer

    Have you considered using a plugin like Yoast SEO? It allows you to manually set your title tag on each page.

    #656567
    generator

    I had no need to use Yoast because individual page titles already came from the wordpress-page-title-field in the backend. This worked fine since forever without any coding, just by default. But now suddenly the tag is empty (or only filled with the title from settings tab).

    EDIT: Ok, now I tried to simply add it using a Hook-Element wp_head but it doesn’t show up. Can you recommend a filter for the functions.php that touches the front-page title, so I can set it this way.
    Or how can I otherwise edit your title-tag, I wanted to add code mentioned in the links here in this thread.

    #657044
    Tom
    Lead Developer
    Lead Developer

    Give this function a try:

    add_filter( 'document_title_parts', function( $title ) {
        if ( is_front_page() ) {
            $title['title'] = 'Your home page title';
        }
    
        return $title;
    } );

    Let me know πŸ™‚

    #660435
    generator

    Ok, thank you very much that worked.

    #660451
    Tom
    Lead Developer
    Lead Developer
Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.