WordPress.org

Ready to get started?Download WordPress

Forums

WordPress SEO by Yoast
Where to set separator character? (3 posts)

  1. Adwiz
    Member
    Posted 1 year ago #

    Version 1.2.8.2 of WordPress SEO puts %%sep%% into all the title boxes, which makes a certain amount of sense. But it says "The separator defined in your theme's wp_title() tag." and I can't find that reference, even after doing a full search in all the theme files. Where does that go, and if a theme doesn't define wp_title(), how do I define it?

    http://wordpress.org/extend/plugins/wordpress-seo/

  2. milian
    Member
    Posted 1 year ago #

    In yoast titles settings you can just replace %%sep%% with the character you want to use

    |
    >
    -

    etc. Try that.

  3. kellydc3
    Member
    Posted 1 year ago #

    In your WordPress template put your desired sep (separator) in the wp_title() tag. So if you want to use the pipe | character, your wp_title should look like:

    wp_title('|')

    This is usually in the head.php file of your theme. Most likely between the <title></title> HTML tag.

    For my themes, I use the following PHP which can be used conditionally with or without SEO by Yoast:

    <title><?php
    	### Print the <title> tag based on what is being viewed.
    	global $page, $paged;
    
    	if(defined('WPSEO_URL')){ // If Using WordPress SEO Yoast - let it override
    		wp_title('|');
    	} else {
    		wp_title( '|', true, 'right' );
    		// Add the blog name.
    		bloginfo( 'name' );
    		// Add the blog description for the home/front page.
    		$site_description = get_bloginfo( 'description', 'display' );
    		if ( $site_description && ( is_home() || is_front_page() ) ) {
    			echo " | $site_description";
    		}
    	}
    	// Add a page number if necessary:
    	if ( $paged >= 2 || $page >= 2 ) {
    		echo ' | ' . sprintf( __( 'Page %s', 'Test Theme' ), max( $paged, $page ) );
    	}
    	?></title>

    The above will allow you to use the %%sep%% designation in SEO by Yoast and use your own separator character.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic