Archived topic
automatic changes to content in - can they be overridden?
5 replies · Started by Maxwell on October 6, 2018
I see "GP doesn’t do anything title tag or description meta related" so maybe the following problems are caused by WordPress, but any help would be appreciated.
For my front page, text placed in the Customize > Site Identity > Tagline field is automatically appended to the site header title and inserted into the <title> within the <head>. (1) Is there a way to keep the Tagline (description) out of that?
For my second page, text placed in the Pages > Edit Page > "Enter title here" field gets automatically prepended to the site header title and placed in the <title> in the <head> of that page. (2) Is there a way to keep the site header title out of that page's title?
(3) Does it affect SEO to check the "Hide site title" and "Hide site tagline" boxes in the Site Identity?
Thanks for any help!
Hi there,
an SEO plugin like Yoast will allow you to amend the SEO Title - so you can choose which tags are used or manually overwrite them.
Thanks, I particularly don't want to use Yoast. If I made the change with the GP HTML editor, will my change be reversed automatically at some unpredictable time, since the error occurred automatically (I don't know whether by the WP core or by GeneratePress)?
Thanks!
OK, so lets use this filter:
add_filter( 'document_title_parts', function( $title )
{
if ( is_home() || is_front_page() )
unset( $title['tagline'] ); /** Remove tagline */
if ( is_single() )
unset( $title['site'] ); /** Remove site name */
return $title;
}, 10, 1 );
Thank you tons!
You're welcome