Disable WP REST metadata

// Remove the REST API lines from the HTML Header remove_action(‘ wp_head’, ‘rest_output_link_wp_head’, 10 ); // completely disable json api // Filters for WP-API version 1.x add_filter( ‘json_enabled’, ‘__return_false’ ); add_filter( ‘json_jsonp_enabled’, ‘__return_false’ ); // Filters for WP-API version 2.x…Continue reading

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

Disable jQuery Migrate

add_action( ‘wp_default_scripts’, function ( $scripts ) { if ( ! is_admin() && isset( $scripts->registered[‘jquery’] ) ) { $script = $scripts->registered[‘jquery’]; if ( ! empty( $script->deps ) ) { $script->deps = array_diff( $script->deps, array( ‘jquery-migrate’ ) ); } } }, 150…Continue reading

Remove hyperlink from name field

add_filter(‘preprocess_comment’, ‘remove_links_from_comment_author’); function remove_links_from_comment_author($commentdata) { // Regular expression to detect hyperlinks $pattern = ‘/Continue reading

Remove Recurring Donation Time Periods

/** * This snippet removes some options for recurring donation periods with Charitable’s Recurring Donations addon. * This might reset or cause odd things to happen to campaigns who resave settings without updating the period if * they already selected…Continue reading