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
@amboutwe
amboutwe / yoast_seo_breadcrumb_add_woo_shop.php
Last active Jun 17, 2019
Multiple examples of how to customize the Yoast SEO breadcrumbs
View yoast_seo_breadcrumb_add_woo_shop.php
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/*
* Add shop link to the Yoast SEO breadcrumbs for a WooCommerce shop page.
* Credit: https://wordpress.stackexchange.com/users/8495/rjb
* Last Tested: Apr 20 2017 using Yoast SEO 4.6 on WordPress 4.7.3
*/
add_filter( 'wpseo_breadcrumb_links', 'wpseo_breadcrumb_add_woo_shop_link' );
@amboutwe
amboutwe / yoast_seo_opengraph_change_image_size.php
Last active Jun 13, 2019
Code snippet to change or remove OpenGraph output in Yoast SEO. There are multiple snippets in this code.
View yoast_seo_opengraph_change_image_size.php
<?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 24 2019 using Yoast SEO 11.2.1 on WordPress 5.2.1
*/
add_filter( 'wpseo_opengraph_image_size', 'yoast_seo_opengraph_change_image_size' );
function yoast_seo_opengraph_change_image_size( $string ) {
@amboutwe
amboutwe / yoast_seo_breadcrumb_remove_link.php
Last active Jun 7, 2019
Remove link from the Yoast SEO breadcrumbs site wide
View yoast_seo_breadcrumb_remove_link.php
@amboutwe
amboutwe / yoast_seo_breadcrumbs_replace_woocommerce.php
Last active Jun 6, 2019
There are two sets of code in this gist. One for non-WooThemes and one for WooThemes. Only copy the section you need to replace breadcrumbs
View yoast_seo_breadcrumbs_replace_woocommerce.php
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/* Replace WooCommerce Breadcrumbs With Yoast Breadcrumbs
* Credit: Unknown
* Last Tested: Jan 25, 2018 using Yoast SEO 6.2 on WordPress 4.9.2
* Theme: Most themes like Twenty Seventeen, Genesis, and WooThemes
*/
// Remove WooCommerce Breadcrumbs
@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 ) {
@amboutwe
amboutwe / yoast_local_labels_custom.php
Last active Jun 4, 2019
Yoast SEO: Local - Custom label for Business Phone 2
View yoast_local_labels_custom.php
<?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', 'wpseo_local_alter_contact_details', 10, 1 );
@amboutwe
amboutwe / yoast_seo_admin_remove_columns.php
Last active May 22, 2019
Remove Yoast SEO columns from posts and pages
View yoast_seo_admin_remove_columns.php
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/* Remove Yoast SEO Columns
* Credit: Andrew Norcross http://andrewnorcross.com/
* Last Tested: Jul 06 2017 using Yoast SEO 5.0 on WordPress 4.8
*
* If you have custom post types, you can add additional lines in this format
* add_filter( 'manage_edit-{$post_type}_columns', 'custom_remove_yseo_columns', 10, 1 );
* replacing {$post_type} with the name of the custom post type.
@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_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_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' );
You can’t perform that action at this time.