Home / Admin / Dynamically Change the SEO Title of a Specific Term Before the Metadata is Saved
Duplicate Snippet

Embed Snippet on Your Site

Dynamically Change the SEO Title of a Specific Term Before the Metadata is Saved

The code snippet below can be used to dynamically change the SEO title of a specific term before the metadata is saved.

<10
Code Preview
php
<?php
add_filter( "aioseo_save_term", "aioseo_filter_term_data" );
function aioseo_filter_term_data( $term ) {
	if ( 12 === (int) $term->term_id ) {
		$term->title = 'Some new title here';
	}
	return $term;
}

Comments

Add a Comment