Skip to content

Instantly share code, notes, and snippets.

@mannieschumpert
Last active August 29, 2015 14:11
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save mannieschumpert/6adbae86c4e82f461533 to your computer and use it in GitHub Desktop.
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