Skip to content

Instantly share code, notes, and snippets.

Avatar
😊
Coding SEOPress, best WordPress SEO plugin

Benjamin Denis wp-seopress

😊
Coding SEOPress, best WordPress SEO plugin
View GitHub Profile
@wp-seopress
wp-seopress / remove-inline-css-of-the-local-business-block-block-editor.php
Last active Jun 23, 2022
Remove inline CSS of the Local Business block (Block Editor)
View remove-inline-css-of-the-local-business-block-block-editor.php
add_action( 'wp_enqueue_scripts', 'sp_remove_local_business_block_styles' );
function sp_remove_local_business_block_styles() {
wp_dequeue_style( 'wpseopress-local-business-style' );
}
@wp-seopress
wp-seopress / filter-breadcrumbs-inline-css-for-the-block-editor.php
Created Jun 23, 2022
Filter breadcrumbs inline CSS for the Block Editor
View filter-breadcrumbs-inline-css-for-the-block-editor.php
remove_action( 'wp_head', 'seopress_breadcrumbs_inline_css', 30 );
@wp-seopress
wp-seopress / filter-list-of-taxonomies-from-xml-sitemap-options.php
Created Jun 11, 2022
Filter list of taxonomies from xml sitemap options
View filter-list-of-taxonomies-from-xml-sitemap-options.php
function sp_sitemaps_tax($taxonomies) {
//remove a custom taxonomy
unset($taxonomies['my_custom_taxonomy']);
return $taxonomies;
}
add_filter('seopress_sitemaps_tax', 'sp_sitemaps_tax');
@wp-seopress
wp-seopress / filter-list-of-post-types-from-xml-sitemap-options.php
Last active Jun 11, 2022
Filter list of post types from xml sitemap options
View filter-list-of-post-types-from-xml-sitemap-options.php
function sp_sitemaps_cpt($post_types) {
//add a post type
$post_types['my_cpt_key'] = (object)[
'name' => 'my_cpt_name',
'labels' => (object)[
'name' => 'my_cpt_name'
],
];
//remove a post type
@wp-seopress
wp-seopress / use-the-old-schema-markup-for-breadcrumbs.php
Created May 11, 2022
Use the old schema markup for Breadcrumbs
View use-the-old-schema-markup-for-breadcrumbs.php
add_filter('seopress_breadcrumbs_old_markup', '__return_true');
@wp-seopress
wp-seopress / filter-home-url-for-google-inspect-url-api.php
Last active May 19, 2022
Filter home URL for Google Inspect URL API
View filter-home-url-for-google-inspect-url-api.php
//In case you use a property domain with Google Search console
function sp_inspect_url_home_url($home_url) {
//default: get_home_url();
return 'sc-domain:example.com';
}
add_filter('seopress_inspect_url_home_url', 'sp_inspect_url_home_url');
@wp-seopress
wp-seopress / filter-url-to-inspect-with-google-inspect-url-api.php
Created May 9, 2022
Filter URL to inspect with Google Inspect URL API
View filter-url-to-inspect-with-google-inspect-url-api.php
function sp_inspect_url_permalink($url) {
//default: get_permalink();
return $url;
}
add_filter('seopress_inspect_url_permalink', 'sp_inspect_url_permalink');
View filter-xsl-video-sitemap.php
add_filter('seopress_sitemaps_video_xsl', 'sp_sitemaps_video_xsl');
function sp_sitemaps_video_xsl($xsl)
{
//var_dump($xsl);
//do your stuff
return $xsl;
}
View filter-the-css-of-email-notifications.php
add_filter('seopress_insights_email_alert_css', 'sp_insights_email_alert_css');
function sp_insights_email_alert_css($css) {
$css = '<style>#wrapper {background: red}</style>';
return $css;
}
@wp-seopress
wp-seopress / filter-the-description-of-email-notifications.php
Created Apr 7, 2022
Filter the description of email notifications
View filter-the-description-of-email-notifications.php
add_filter('seopress_insights_email_alert_desc', 'sp_insights_email_alert_desc');
function sp_insights_email_alert_desc($desc) {
$desc = __('My custom description','text-domain');
return $desc;
}