Skip to content

Instantly share code, notes, and snippets.

@ochui
Created September 29, 2020 06:08
Show Gist options
  • Save ochui/ebe1a692e88da9cf3a37c692f3d1e76d to your computer and use it in GitHub Desktop.
Save ochui/ebe1a692e88da9cf3a37c692f3d1e76d to your computer and use it in GitHub Desktop.
Override Yoast SEO existing title or meta template variable
function filter_wpseo_replacements( $replacements ) {
if( isset( $replacements['%%currentmonth%%'] ) ){
$replacements['%%currentmonth%%'] = 'Sept';
}
return $replacements;
};
// Add filter
add_filter( 'wpseo_replacements', 'filter_wpseo_replacements', 10, 1 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment