This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/ | |
/* Add Sitemap Index To Generated Robots.txt | |
* Credit: Ben https://github.com/retlehs | |
* Last Tested: Mar 13 2017 using Yoast SEO 4.4 on WordPress 4.7.3 | |
*/ | |
add_action('do_robots', 'custom_robotstxt'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/ | |
/* Remove Yoast SEO Title From All Pages | |
* Credit: Yoast Team | |
* Last Tested: Jun 17 2020 using Yoast SEO 14.3 on WordPress 5.4.2 | |
*/ | |
add_filter( 'wpseo_title', '__return_false' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/ | |
/* Prevent Yoast SEO for adding specific post types to indexables | |
* Credit: Yoast team | |
* Last Tested: Jan 18 2021 using Yoast SEO 15.6.2 on WordPress 5.6 | |
* Documented: https://github.com/Yoast/wordpress-seo/blob/trunk/src/helpers/post-type-helper.php#L90 | |
* Common post types: 'post', 'page', 'attachment', 'product' | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/ | |
/* Remove Yoast SEO Change existing title or meta template variable | |
* Credit: Moshe Harush | |
* https://stackoverflow.com/questions/36281915/yoast-seo-how-to-create-custom-variables | |
* Last Tested: Unknown | |
*/ | |
// define the wpseo_replacements callback | |
function filter_wpseo_replacements( $replacements ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/ | |
/* Add custom separators to the Yoast SEO options | |
* Credit: Yoast team | |
* Last Tested: September 2, 2021 using Yoast SEO 17.0 on WordPress 5.8 | |
*/ | |
add_filter( 'wpseo_separator_options', 'yoast_seo_title_add_separators', 10 , 1 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/ | |
/* Change Yoast SEO Prev/Next URL on some pages | |
* Credit: Yoast Team | |
* Last Tested: Jun 10 2017 using Yoast SEO 4.9 on WordPress 4.8 | |
*/ | |
add_filter( 'wpseo_next_rel_link', 'custom_change_wpseo_next' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/ | |
/* Change the pagination limit for the Yoast SEO bulk editor | |
* Credit: https://github.com/emmelemme | |
* Last Tested: Aug 08 2023 using Yoast SEO 20.12 on WordPress 6.2.2 | |
* Default = 10 items per page | |
*/ | |
add_filter('wpseo_posts_per_page', function($number){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/ | |
/* Disable Yoast SEO Emoji Script | |
* Credit: Yoast team | |
* Last Tested: Oct 24 2023 using Yoast SEO (free and premium) 21.4 on WordPress 6.3.2 | |
*/ | |
add_filter( 'wpseo_premium_load_emoji_picker', '__return_false' ); |