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_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_robots_add_sitemap.php
Last active Jul 29, 2018
Add the Yoast SEO sitemap index to the WordPress generated robots.txt file.
View yoast_seo_robots_add_sitemap.php
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/* Add Sitemap Index To Generated Robots.txt
* Credit: Ben https://github.com/retlehs
* Last Tested: Mar 13 2017 using Yoast SEO 4.4 on WordPress 4.7.3
*/
add_action('do_robots', 'custom_robotstxt');
@amboutwe
amboutwe / yoast_seo_sitemap_add_custom_type.php
Last active Mar 7, 2019
Filters and example code for Yoast SEO sitemaps
View yoast_seo_sitemap_add_custom_type.php
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/* Create Custom Yoast Sitemap
* Credit: Unknown
* Last Tested: Unknown
*********
* HOW TO USE
* Replace TYPE with your custom type
*/
@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_prev_next_change.php
Last active Jul 9, 2019
Remove or modify the Yoast SEO prev or next URLs. Only copy the section of code you need.
View yoast_seo_prev_next_change.php
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/* Change Yoast SEO Prev/Next URL on some pages
* Credit: Yoast Team
* Last Tested: Jun 10 2017 using Yoast SEO 4.9 on WordPress 4.8
*/
add_filter( 'wpseo_next_rel_link', 'custom_change_wpseo_next' );
@amboutwe
amboutwe / yoast_seo_sitemap_exclude_taxonomy.php
Last active Jul 29, 2018
Sitemaps: There are two sets of code in this gist, one for a single taxonomy or for multiple taxonomies. Only copy the section you need and replace the taxonomy_slug with the actual name of the taxonomy slug to be excluded.
View yoast_seo_sitemap_exclude_taxonomy.php
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/* Exclude One Taxonomy From Yoast SEO Sitemap
* Credit: Yoast KB https://kb.yoast.com/kb/how-to-customize-the-sitemap-index/
* Last Tested: Apr 05 2018 using Yoast SEO 7.2 on WordPress 4.9.5
*********
* Please note that changes will be applied upon next sitemap update.
* To manually refresh the sitemap, please disable and enable the sitemaps.
*/
@amboutwe
amboutwe / yoast_seo_json_remove.php
Last active Apr 16, 2019
Remove all JSON output by Yoast SEO
View yoast_seo_json_remove.php
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/* Remove all JSON output by Yoast SEO
* Credit: Yoast development team
* Documentation: https://developer.yoast.com/schema-documentation/api/
* Last Tested: Apr 16 2019 using Yoast SEO 11.0 on WordPress 5.1.1
*/
add_filter( 'wpseo_json_ld_output', '__return_false' );
@amboutwe
amboutwe / yoast_seo_primary_category_disable.php
Last active Oct 24, 2018
Disable Yoast SEO Primary Category Feature
View yoast_seo_primary_category_disable.php
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/* Disable Yoast SEO Primary Category Feature
* Credit: Yoast development team
* Last Tested: Jan 24 2017 using Yoast SEO 4.1 on WordPress 4.7.1
*/
add_filter( 'wpseo_primary_term_taxonomies', '__return_empty_array' );
@amboutwe
amboutwe / yoast_seo_meta_remove_dates.php
Last active Jul 31, 2019
Remove Date Meta Tags Output by Yoast SEO
View yoast_seo_meta_remove_dates.php
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/* Remove Date Meta Tags Output by Yoast SEO
* Credit: Yoast development team
* Last Tested: Apr 09 2019 using Yoast SEO 10.1.3 on WordPress 5.1.1
*/
add_action('wpseo_dc_'.'DC.date.issued', '__return_false'); // older Premium versions only
add_filter( 'wpseo_og_article_published_time', '__return_false' );
@amboutwe
amboutwe / yoast_seo_opengraph_change_image_size.php
Last active Aug 14, 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 ) {
You can’t perform that action at this time.