• Resolved strid3r

    (@strid3r)


    If I don’t touch any settings, the seo plugin automatically sets the page SEO title as “Page Title – Site Title” format which is perfect.

    If I want to manually create a new SEO page title from the editor, and I want to keep the same formatting as the rest of the site with Site Title as a prefix, I have to manually type in the Site Title each time.

    Is there a way to manually create a page title and have the Site Title automatically added to the new custom title so that I don’t have to type in the site title to every single page I want to edit the SEO title for?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Anh Tran

    (@rilwis)

    Hi @strid3r ,

    Thanks for your feedback. Please use this snippet to auto append the site title to the manual meta title:

    add_filter( 'slim_seo_meta_title', function( $title ) {
        if ( ! is_singular() ) {
            return $title;
        }
        $slim_seo = get_post_meta( get_the_ID(), 'slim_seo', true );
        if ( empty( $slim_seo['title'] ) ) {
            return $title;
        }
        return $slim_seo['title'] . ' - ' . get_bloginfo( 'name' );
    } );

    It’s also added to the docs as well.

    Thread Starter strid3r

    (@strid3r)

    Awesome. Thank you so much. All the best to you 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Add site name to page title?’ is closed to new replies.