Skip to content

Instantly share code, notes, and snippets.

Angi amboutwe

Block or report user

Report or block amboutwe

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View yoast_seo_sitemap_include_empty_terms.php
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/* Include empty terms in the sitemap
* Credit: Yoast team
* Last Tested: Mar 22 2019 using Yoast SEO 10.0.1 on WordPress 5.1.1
*/
add_filter('wpseo_sitemap_exclude_empty_terms', '__return_false');
@amboutwe
amboutwe / yoast_seo_disable_single_post.php
Last active May 15, 2019
Remove Yoast from front and back end for a single post or page
View yoast_seo_disable_single_post.php
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/* Remove Yoast from front and back end for a single post or page
* Credit: Dodinas https://stackoverflow.com/questions/37845968/disable-wordpress-yoast-seo-on-single-page
* Last Tested: Jul 13 2018 using Yoast SEO 7.8 on WordPress 4.9.7
*********
* DIFFERENT POST TYPES
* Post: Change 123456 to the post ID
* Page: Change is_single to is_page and 123456 to the page ID
* Custom Post Type: Change is_single to is_singular and 123456 to the 'post_type_slug'
@amboutwe
amboutwe / yoast_seo_replytocom.php
Last active Jul 29, 2018
By default, Yoast SEO removes `?replytocom` variables from URLs. This can be reversed with the following code.
View yoast_seo_replytocom.php
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/*
* Yoast SEO return `?replytocom` variables
* Credit: Yoast development team
* Last Tested: Mar 23 2018 using Yoast SEO 7.1 on WordPress 4.9.4
*/
add_filter( 'wpseo_remove_reply_to_com', '__return_false' );
@amboutwe
amboutwe / yoast_seo_title_change-variable.php
Last active Jun 5, 2019
Change existing or add custom title or meta template variables
View yoast_seo_title_change-variable.php
<?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 ) {
View yoast_seo_roles_remove.php
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/* Remove Yoast SEO user roles
* Credit: Yoast Team
* Last Tested: Oct 25 2017 using Yoast SEO 5.7.1 on WordPress 4.8.2
*/
// Remove Yoast `SEO Manager` role
if ( get_role('wpseo_manager') ) {
remove_role( 'wpseo_manager' );
@amboutwe
amboutwe / yoast_seo_title_remove.php
Last active May 7, 2019
Yoast SEO title snippets
View yoast_seo_title_remove.php
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/* Remove Yoast SEO Title From All Pages
* Credit: Yoast Team
* Last Tested: Aug 11 2017 using Yoast SEO 5.2 on WordPress 4.8.1
*/
add_filter( 'wpseo_title', '__return_false' );
@amboutwe
amboutwe / yoast_seo_admin_user_remove_social.php
Last active May 18, 2019
Remove Yoast SEO Social Profiles From All Users
View yoast_seo_admin_user_remove_social.php
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/* Remove Yoast SEO Social Profiles From All Users
* Credit: Yoast Developers
* Last Tested: May 18 2019 using Yoast SEO 11.2.1 on WordPress 5.2
*/
add_filter('user_contactmethods', 'yoast_seo_admin_user_remove_social');
@amboutwe
amboutwe / yoast_seo_canonical_change_home_url_slash.php
Last active Jul 9, 2019
Code snippets for the Yoast SEO canonical output
View yoast_seo_canonical_change_home_url_slash.php
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/* Add Trailing Slash to Home Canonical - Yoast SEO
* Credit: Unknown
* Last Tested: Unknown
*/
add_filter( 'wpseo_canonical', 'yoast_seo_canonical_change_home_url_slash' );
function yoast_seo_canonical_change_home_url_slash( $canonical_url ) {
@amboutwe
amboutwe / yoast_seo_dashboard_widget_remove.php
Last active Jun 27, 2019
Remove Yoast SEO Dashboard Widget
View yoast_seo_dashboard_widget_remove.php
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/* Remove Yoast SEO Dashboard Widget
* Credit: Unknown
* Last Tested: Jun 16 2017 using Yoast SEO 4.9 on WordPress 4.8
*/
add_action('wp_dashboard_setup', 'remove_wpseo_dashboard_overview' );
@amboutwe
amboutwe / yoast_video_remove_yandex.php
Last active Apr 21, 2019
Remove Yandex tags from Yoast SEO Video
View yoast_video_remove_yandex.php
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/* Remove Yandex tags from Yoast SEO Video
* Credit: Yoast development team
* Last Tested: May 12 2017 using Yoast SEO Video 4.7 on WordPress 4.7.4
*/
add_filter( 'wpseo_video_yandex_support', '__return_false' );
You can’t perform that action at this time.