Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
WP SEO: Modify SEO Title for Custom Post Type
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;
}
array = (
['%%title%%'] => 'Your Post Title',
['%%sep%%'] => '-',
['%%sitename%%'] => 'Your Site Name'
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment