Disable Update Emails

// Disable auto-update email notifications add_filter(‘auto_core_update_send_email’, ‘disable_auto_update_emails’, 10, 4); function disable_auto_update_emails($send, $type, $core_update, $result) { if ( !empty($type) && $type == ‘success’ ) { return false; } return true; } // Disable plugin and theme update email notifications add_filter(‘auto_plugin_update_send_email’, ‘__return_false’);…Continue reading

Change Twitter Title for a Specific Post

add_filter( ‘aioseo_twitter_tags’, ‘aioseo_filter_twitter_title’ ); function aioseo_filter_twitter_title( $twitterMeta ) { if ( is_singular() && ’14’ === get_the_ID() ) { $twitterMeta[‘twitter:title’] = “A different title”; } return $twitterMeta; }Continue reading

Add Translated Version Sitemap Entries for a Specific Term

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

Change Time zone Offset in the Publish Date of the Sitemap Entries

add_filter( ‘aioseo_sitemap_rss’, ‘aioseo_filter_rss_sitemap_entries’ ); function aioseo_filter_rss_sitemap_entries( $entries ) { $entries = array_map( function ( $entry ) { if ( empty( $entry[‘pubDate’] ) ) { return $entry; } $dateTime = new DateTime(); $dateTime->setTimestamp( strtotime( $entry[‘pubDate’] ) ); $dateTime->setTimezone( new DateTimeZone( ‘Europe/Moscow’…Continue reading

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