aioseo_save_post

This filter can be used to manipulate all SEO/social markup/schema data for an individual post when it is saved.

Parameters (1)

$post (AIOSEO\Common\Models\Post)
The AIOSEO post object.

The object properties are subject to change and therefore not included in this documentation. For a full list of object properties, we recommend inspecting an instance of this object in a local development environment.

Example code snippet

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

add_filter( "aioseo_save_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;
}

Changelog

VersionDescription
4.2.2Introduced.