Skip to content

Instantly share code, notes, and snippets.

@swest
Created July 13, 2018 11:34
Show Gist options
  • Save swest/c4ea212198b6809fa05e33bef2c83828 to your computer and use it in GitHub Desktop.
Save swest/c4ea212198b6809fa05e33bef2c83828 to your computer and use it in GitHub Desktop.
The Yoast SEO Premium's redirects manager includes automatic redirect creation and redirect request notifications. In rare cases, you may prefer to turn off some of these features.
<?php
/*
* from https://kb.yoast.com/kb/how-to-disable-automatic-redirects/
*
* Yoast SEO Disable Automatic Redirects for
* Posts And Pages
* Credit: Yoast Development Team
* Last Tested: May 09 2017 using Yoast SEO Premium 4.7.1 on WordPress 4.7.4
*/
add_filter('wpseo_premium_post_redirect_slug_change', '__return_true' );
/*
* Yoast SEO Disable Automatic Redirects for
* Taxonomies (Category, Tags, Etc)
* Credit: Yoast Development Team
* Last Tested: May 09 2017 using Yoast SEO Premium 4.7.1 on WordPress 4.7.4
*/
add_filter('wpseo_premium_term_redirect_slug_change', '__return_true' );
/*
* Yoast SEO Disable Redirect Notifications for
* Posts or Pages: Moved to Trash
* Credit: Yoast Development Team
* Last Tested: May 09 2017 using Yoast SEO Premium 4.7.1 on WordPress 4.7.4
*/
add_filter('wpseo_enable_notification_post_trash', '__return_false');
/*
* Yoast SEO Disable Redirect Notifications for
* Posts and Pages: Change URL
* Credit: Yoast Development Team
* Last Tested: May 09 2017 using Yoast SEO Premium 4.7.1 on WordPress 4.7.4
*/
add_filter('wpseo_enable_notification_post_slug_change', '__return_false');
/*
* Yoast SEO Disable Redirect Notifications for
* Taxonomies: Moved to Trash
* Credit: Yoast Development Team
* Last Tested: May 09 2017 using Yoast SEO Premium 4.7.1 on WordPress 4.7.4
*/
add_filter('wpseo_enable_notification_term_delete','__return_false');
/*
* Yoast SEO Disable Redirect Notifications for
* Taxonomies: Change URL
* Credit: Yoast Development Team
* Last Tested: May 09 2017 using Yoast SEO Premium 4.7.1 on WordPress 4.7.4
*/
add_filter('wpseo_enable_notification_term_slug_change','__return_false');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment