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_opengraph_add_publish_date_post_types.php
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/* Enable OpenGraph published and modified dates for all post types
* Credit: Yoast team
* Last Tested: Oct 01 2019 using Yoast SEO 12.2 on WordPress 5.2.3
*/
add_filter('wpseo_opengraph_show_publish_date', '__return_true');
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 Nov 11, 2019
Remove Yoast from front 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 end for a single post or page
* Credit: Dodinas https://stackoverflow.com/questions/37845968/disable-wordpress-yoast-seo-on-single-page
* Last Tested: Nov 08 2019 using Yoast SEO 12.4 on WordPress 5.2.4
*********
* 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 Oct 16, 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 Sep 1, 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 Oct 17, 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_woocom_shop.php
Last active Oct 25, 2019
Code snippets for the Yoast SEO canonical output
View yoast_seo_canonical_change_woocom_shop.php
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/* Change the canonical link for the shop page
* Credit: Scott Weiss of somethumb.com
* Last Tested: Jan 25 2017 using Yoast SEO 6.0 on WordPress 4.9.1
*/
function yoast_seo_canonical_change_woocom_shop( $canonical ) {
if ( !is_shop() ) {
@amboutwe
amboutwe / yoast_seo_dashboard_widget_remove.php
Last active Oct 16, 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' );
You can’t perform that action at this time.