mannieschumpert
12/15/2014 - 4:38 PM

WP SEO: Modify SEO Title for Custom Post Type

WP SEO: Modify SEO Title for Custom Post Type

array = (
    ['%%title%%'] => 'Your Post Title',
    ['%%sep%%'] => '-',
    ['%%sitename%%'] => 'Your Site Name'
)
add_filter( 'wpseo_replacements', 'mannie_filter_seo_replacements' );
function mannie_filter_seo_replacements( $replacements ){

    global $post;

    if ( isset( $replacements['%%title%%'] ) && $post->post_type === 'project' )
        $replacements['%%title%%'] = 'Project: ' . $replacements['%%title%%'];

    return $replacements;
}