Remove Emojis

/** * Disable the emojis in WordPress. */ add_action( ‘init’, function () { remove_action( ‘wp_head’, ‘print_emoji_detection_script’, 7 ); remove_action( ‘admin_print_scripts’, ‘print_emoji_detection_script’ ); remove_action( ‘wp_print_styles’, ‘print_emoji_styles’ ); remove_action( ‘admin_print_styles’, ‘print_emoji_styles’ ); remove_filter( ‘the_content_feed’, ‘wp_staticize_emoji’ ); remove_filter( ‘comment_text_rss’, ‘wp_staticize_emoji’ ); remove_filter( ‘wp_mail’,…Continue reading

Elementor – Fix the Accordion SEO issue

add_filter( ‘elementor/widget/render_content’, function ( $widget_content, $widget ) { if ( ‘accordion’ === $widget->get_name() ) { $widget_content = preg_replace( ‘/]*class=”elementor-accordion-title”[^>]*>(.*?)/’, ‘$1‘, $widget_content ); } if ( ‘toggle’ === $widget->get_name() ) { $widget_content = preg_replace( ‘/]*class=”elementor-toggle-title”[^>]*>(.*?)/’, ‘$1‘, $widget_content ); } return $widget_content;…Continue reading

Trigger a Scheduled Export via a WordPress Action

function custom_trigger_scheduled_export_url() { $secret_key = ( isset( $_GET[‘secret_key’] ) ? sanitize_text_field( $_GET[‘secret_key’] ) : false ); if( empty( $secret_key ) ) { return; } if( $secret_key == ‘SECRET_KEY_PASSED_VIA_CRON’ ) { // This is the Post ID of the Scheduled Export…Continue reading

Remove Author Schema entirely from the website

add_filter( ‘aioseo_schema_output’, ‘add_author_name_when_missing’ ); function add_author_name_when_missing( $schema ) { foreach ( $schema as &$schemaItem ) { if ( isset($schemaItem[‘author’]) ) { unset($schemaItem[‘author’]); } } return $schema; }Continue reading

WP Simple Pay: {subtotal} Smart Tag

/** * @link https://library.wpcode.com/snippet/r5plvkeo/ */ add_filter( ‘simpay_payment_details_template_tags’, function( $smart_tags ) { $smart_tags[] = ‘subtotal’; return $smart_tags; } ); add_filter( ‘simpay_payment_confirmation_template_tag_subtotal’, function( $value, $payment_confirmation_data ) { $subscription = current( $payment_confirmation_data[‘subscriptions’] ); if ( $subscription ) { $payment = $subscription->latest_invoice->payment_intent; } else…Continue reading

Add missing mainEntity to ProfilePage Schema

add_filter( ‘aioseo_schema_output’, function ( $schema ) { foreach ( $schema as &$schemaItem ) { if ( empty( $schemaItem[‘mainEntity’] ) && isset( $schemaItem[‘@type’] ) && ‘ProfilePage’ === $schemaItem[‘@type’] ) { global $wp; $current_url = untrailingslashit( home_url( $wp->request ) ); $schemaItem[‘mainEntity’] =…Continue reading