Site logo

[Resolved] SEO for Title Tag / Page Title / Featured Image

Home Forums Support [Resolved] SEO for Title Tag / Page Title / Featured Image

Home Forums Support SEO for Title Tag / Page Title / Featured Image

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1917210
    Robert

    Hi,
    I am also having similar feedback regarding my site’s H1 Title tags for SEO.

    I think the theme automatically creates both the SEO Title Tag and the page title (as a <h1> tag) from the ‘Add title’ when first starting a new page/post.

    However, for SEO I want to have a different SEO Title Tag (i.e.: <TITLE></TITLE>) from the page title that is shown to users (i.e.: H1 Page title)

    The only way I can do this at the moment is to add the SEO Title Tag that I want when starting a new post and prompted to Add Title and then using the HIDE Title Content option.
    I then add a Headline Block and set that as H1.

    This seems to work (only one H1 on the visible page from my Headline block) however it means my Featured Image is always above the Headline Block. Is there any way of changing that?

    Is there anything else I should know when ‘hiding’ the title content?

    Thanks,
    Rob

    #1917502
    David
    Staff
    Customer Support

    Hi there,

    the theme doesn’t do anything fancy with the Title tag, it simply uses the core wp_title function, which by default will output the content title / site title.

    Most SEO plugins offer a title meta field that allow you to change the the title tag.
    Or you can create a WP Custom Field to store the value and use this filter to output it to the title tag:

    function db_custom_page_title( $title , $separator) {
        if( is_single() ){ 
            $custom_page_title = get_post_meta( get_the_ID(),'add_your_meta_key', true);
            if( $custom_page_title ){
                $title = $custom_page_title;
            }
        }
        return $title;  
    }
    
    add_filter( 'wp_title', 'db_custom_page_title', 10 , 2 );

    You need to change add_your_meta_key to your Custom Field name.

    This way you can keep your Content Title as is, and the Featured Image can be displayed below the Title automatically.

    #1917508
    Robert

    Thank you!
    Just checked and found that it is easy to do using the free Yoast plugin.
    You guys were great as always!

    #1917608
    David
    Staff
    Customer Support

    Yep 🙂 Glad to hear that!!

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.