Skip to content

Instantly share code, notes, and snippets.

View amboutwe's full-sized avatar

Angi amboutwe

View GitHub Profile
@amboutwe
amboutwe / yoast_seo_sitemap_add_custom_type.php
Last active April 16, 2024 11:21
Filters and example code for Yoast SEO sitemaps
<?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_robots_add_sitemap.php
Last active November 2, 2021 13:17
Add the Yoast SEO sitemap index to the WordPress generated robots.txt file.
<?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_admin_remove_columns.php
Last active February 1, 2024 16:37
Remove Yoast SEO columns from posts and pages
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/* Remove Yoast SEO Columns
* Credit: Andrew Norcross http://andrewnorcross.com/
* Last Tested: Jun 09 2020 using Yoast SEO 14.3 on WordPress 5.4.1
*
* If you have custom post types, you can add additional lines in this format
* add_filter( 'manage_edit-{$post_type}_columns', 'yoast_seo_admin_remove_columns', 10, 1 );
* replacing {$post_type} with the name of the custom post type.