Append Post Count to Category Descriptions in LLMS Files

add_filter( ‘aioseo_llms_term_description’, ‘aioseo_filter_llms_term_description’, 10, 2 ); function aioseo_filter_llms_term_description( $description, $term = null ) { if ( is_a( $term, ‘WP_Term’ ) && ‘category’ === $term->taxonomy && $term->count > 0 ) { $description .= ‘ This category contains ‘ . $term->count .…Continue reading

Remove the LLMS Description for a Specific Post

add_filter( ‘aioseo_llms_post_description’, ‘aioseo_filter_remove_llms_post_description’, 10, 2 ); function aioseo_filter_remove_llms_post_description( $description, $post = null ) { if ( is_a( $post, ‘WP_Post’ ) && 14 === $post->ID ) { return ”; } return $description; }Continue reading

Modify the LLMS Description for a Specific Post

add_filter( ‘aioseo_llms_post_description’, ‘aioseo_filter_llms_post_description’, 10, 2 ); function aioseo_filter_llms_post_description( $description, $post = null ) { if ( is_a( $post, ‘WP_Post’ ) && 14 === $post->ID ) { $description = ‘This is a featured post. ‘ . $description; } return $description; }Continue reading

Add Taxonomy Label to LLMS Term Titles

add_filter( ‘aioseo_llms_term_title’, ‘aioseo_filter_llms_term_title’, 10, 2 ); function aioseo_filter_llms_term_title( $title, $term = null ) { if ( is_a( $term, ‘WP_Term’ ) ) { $taxonomy = get_taxonomy( $term->taxonomy ); if ( $taxonomy ) { $title = $taxonomy->labels->singular_name . ‘: ‘ . $title;…Continue reading

Modify LLMS Title for a Specific Post

add_filter( ‘aioseo_llms_post_title’, ‘aioseo_filter_llms_post_title’, 10, 2 ); function aioseo_filter_llms_post_title( $title, $post = null ) { if ( is_a( $post, ‘WP_Post’ ) && 14 === $post->ID ) { $title = ‘Featured: ‘ . $title; } return $title; }Continue reading

Remove trailing slash from homepage URL in AIOSEO sitemap

function aioseo_remove_trailing_slash_from_homepage( $entry, $post_id, $post_type, $entry_type ) { // Get the homepage ID $homepage_id = aioseo()->helpers->getHomePageId(); // Check if this is the homepage if ( $homepage_id && $post_id === $homepage_id ) { // Remove trailing slash from the URL if…Continue reading

Skip Unwanted 404 Logs

add_filter( ‘aioseo_redirects_log_skip’, ‘redirects_log_skip’, 10, 2 ); function redirects_log_skip( $skip, $data ) { // Define a list of unwanted URLs $ignoreUrls = [ ‘/config.json’, ‘/home’, ‘/main’, ‘/server-status’, ‘/private’ ]; // Skip logging these URLs if they result in a 404 error…Continue reading

Prevent AIOSEO From Rewriting Term Title

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