Add Translated Version Sitemap Entries for a Specific Post

add_filter( “aioseo_sitemap_post”, “aioseo_filter_sitemap_post”, 10, 2 ); function aioseo_filter_sitemap_post( $entry, $postId ) { if ( 10 === $postId ) { // Set the language code for the main URL. $entry[‘language’] = ‘en_US’ // Add the translated versions (language code + URL).…Continue reading

Add Additional Custom Sitemap Index

add_filter( ‘aioseo_sitemap_indexes’, ‘aioseo_add_sitemap_index’ ); function aioseo_add_sitemap_index( $indexes ) { $indexes[] = [ ‘loc’ => ‘https://somedomain.com/custom-sitemap.xml’, ‘lastmod’ => aioseo()->helpers->dateTimeToIso8601( ‘2021-09-08 12:02’ ), ‘count’ => 1000 ]; return $indexes; }Continue reading

Add Image to Sitemap From an Image ACF Field

add_filter( ‘aioseo_sitemap_images’, ‘aioseo_filter_sitemap_images’, 10, 2 ); function aioseo_filter_sitemap_images( $images, $post ) { if ( ! function_exists( ‘get_field’ ) ) { return $images; } $customImage = get_field( ‘custom_image’, $post->ID ); if ( ! empty( $customImage ) ) { $images[] = wp_get_attachment_image_url(…Continue reading

Disable Gravatar Avatars

add_filter( ‘get_avatar’, function( $avatar, $id_or_email, $size, $default, $alt ) { return ”; // Return an empty string to disable the gravatar }, 10, 5 );Continue reading

Disable Categories and Tags

add_action(‘init’, function() { unregister_taxonomy_for_object_type(‘category’, ‘post’); unregister_taxonomy_for_object_type(‘post_tag’, ‘post’); });Continue reading