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_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 ) {
@amboutwe
amboutwe / yoast_seo_breadcrumb_remove_link.php
Last active Aug 13, 2019
Remove link from the Yoast SEO breadcrumbs site wide
View yoast_seo_breadcrumb_remove_link.php
@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_canonical_change_home_url_slash.php
Last active Jul 31, 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_title_change-variable.php
Last active Jul 25, 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 / custom_robots.php
Last active Jul 17, 2019
Filters and example code for Yoast SEO robots or WP robots.txt
View custom_robots.php
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/*
* Replace Disallow with Allow Generated Robots.txt
* Credit: Unknown
* Last Tested: Unknown
*/
add_filter('robots_txt','custom_robots');
@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_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_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_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
You can’t perform that action at this time.