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 *********/ | |
/* Log reason for "could not be resolved" redirect error | |
* Credit: Yoast team | |
* Last Tested: Nov 20 2024 using Yoast SEO 23.9 on WordPress 6.7 | |
*/ | |
function my_log_http_api_debug_event( $response, $context, $class, $parsed_args, $url ){ | |
error_log( "HTTP API Debug: URL: " . $url . " Response: " . print_r( $response, true ) ); |
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 *********/ | |
/* | |
* Replace Disallow with Allow Generated Robots.txt | |
* Credit: Unknown | |
* Last Tested: June 09 2020 using WordPress 5.4.1 | |
*/ | |
add_filter('robots_txt','custom_robots'); |
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 *********/ | |
/* Create a Yoast SEO sitemap for a custom post type | |
* Credit: Team Yoast | |
* Last Tested: Unknown | |
* Documentation: https://developer.yoast.com/features/xml-sitemaps/api/#add-a-custom-post-type | |
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * | |
* HOW TO USE | |
* Replace TYPE with your custom type |
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 size for Yoast SEO OpenGraph image for all content | |
* Credit: Yoast Development team | |
* Last Tested: May 19 2020 using Yoast SEO 14.1 on WordPress 5.4.1 | |
* Accepts WordPress reserved image size names: 'thumb', 'thumbnail', 'medium', 'large', 'post-thumbnail' | |
* Accepts custom image size names: https://developer.wordpress.org/reference/functions/add_image_size/ | |
*/ | |
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 columns for all users site wide | |
* Credit: Andrew Norcross http://andrewnorcross.com/ | |
* Last Tested: Sep 17 2024 using Yoast SEO 23.4 on WordPress 6.6.2 | |
* | |
* If you have custom post types, you can add additional lines in this format | |
* add_filter( 'manage_edit-{$post_type}_columns', 'yoast_seo_admin_remove_columns', 10, 1 ); | |
* replacing {$post_type} with the name of the custom post type. |
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 *********/ | |
/* | |
* Yoast SEO Custom label for Business Phone 2 | |
* Credit: Yoast development team | |
* Last Tested: Apr 28 2017 using Yoast SEO Local 4.6 on WordPress 4.7.4 | |
*/ | |
add_filter('wpseo_local_contact_details', 'yoast_local_label_change_phone_2', 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 the canonical link for the shop page | |
* Credit: Scott Weiss of somethumb.com | |
* Yoast Doc: https://developer.yoast.com/features/seo-tags/canonical-urls/api/ | |
* Last Tested: Jan 25 2017 using Yoast SEO 6.0 on WordPress 4.9.1 | |
*/ | |
add_filter( 'wpseo_canonical', 'yoast_seo_canonical_change_woocom_shop', 10, 1 ); |
NewerOlder