Home / Admin / Dynamically Change the SEO title of a Specific Post when the Metadata is Loaded
Duplicate Snippet

Embed Snippet on Your Site

Dynamically Change the SEO title of a Specific Post when the Metadata is Loaded

This filter can be used to dynamically change the SEO title of a specific post when the metadata is loaded

10+
Code Preview
php
<?php
add_filter( "aioseo_get_post", "aioseo_filter_post_data" );
function aioseo_filter_post_data( $post ) {
	if ( 10 === (int) $post->post_id ) {
		$post->title = 'Some new title here';
	}
	return $post;
}

Comments

Add a Comment