Category: Admin
Dynamically Change the SEO Title of a Specific Term Before the Metadata is Saved
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; }Continue reading
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; }Continue reading
Prevent AIOSEO From Outputting a rel=”prev” Link
add_filter( ‘aioseo_prev_link’, ‘aioseo_filter_prev_link’ ); function aioseo_filter_prev_link( $previous ) { return ”; }Continue reading
Prevent AIOSEO From Outputting a rel=”next” Link
add_filter( ‘aioseo_next_link’, ‘aioseo_filter_next_link’ ); function aioseo_filter_next_link( $next ) { return ”; }Continue reading
Prevent AIOSEO From Outputting any Data on Category Archive Pages
add_filter( ‘aioseo_meta_views’, ‘aioseo_filter_meta_views’ ); function aioseo_filter_meta_views( $views ) { if ( is_category() ) { return []; } return $views; }Continue reading
Change the Post ID Being Processed by AIOSEO
add_filter( ‘aioseo_get_post_id’, ‘aioseo_change_post_id’ ); function aioseo_change_post_id( $postId ) { if( is_post_type_archive( ‘product’ ) ) { $postId = 123; } return $postId; }Continue reading
Disable the AIOSEO Flyout Menu for Non-Administrator Users.
add_filter( ‘aioseo_flyout_menu_enable’, ‘aioseo_filter_flyout_menu_enable’ ); function aioseo_filter_flyout_menu_enable( $enabled ) { if ( ! aioseo()->access->isAdmin() ) { $enabled = false; } return $enabled; }Continue reading
Control Whether AIOSEO Flushes Output Buffer After Rewriting Title
add_filter( ‘aioseo_flush_output_buffer’, ‘__return_false’ );Continue reading
Prevent AIOSEO From Rewriting Term Titles
add_filter( ‘aioseo_disable_title_rewrites’, ‘aioseo_disable_term_title_rewrites’ ); function aioseo_disable_term_title_rewrites( $disabled ) { if ( is_category() || is_tag() || is_tax() ) { return true; } return false; }Continue reading