12 Snippets
<10 Favourites
<10 Downloads

Completely Disable Comments

add_action('admin_init', function () { // Redirect any user trying to access comments page global $pagenow; if…

<10

Allow SVG Files Upload

/** * Allow SVG uploads for administrator users. * * @param array $upload_mimes Allowed mime types.…

<10

Explicit Fixed Width and Height

add_filter( 'the_content', 'add_image_dimensions' ); function add_image_dimensions( $content ) { preg_match_all( '/]+>/i', $content, $images); if (count($images) <…

<10

Disable Emojis

/** * Disable the emojis in WordPress. */ add_action( 'init', function () { remove_action( 'wp_head', 'print_emoji_detection_script',…

<10

Current Year

function current_year_shortcode() { return date('Y'); } add_shortcode('year', 'current_year_shortcode');

<10

Remove Unused JS

/** * We will Dequeue the jQuery UI script as example. * * Hooked to the…

<10

Remove WordPress Version Number

add_filter('the_generator', '__return_empty_string');

<10

Disable Gutenberg Editor (use Classic Editor)

add_filter('gutenberg_can_edit_post', '__return_false', 5); add_filter('use_block_editor_for_post', '__return_false', 5);

<10

Remove Gutenberg CSS

//Remove Gutenberg Block Library CSS from loading on the frontend function smartwp_remove_wp_block_library_css(){ wp_dequeue_style( 'wp-block-library' ); wp_dequeue_style(…

<10

Stop Lazy Load

add_filter( 'wp_lazy_loading_enabled', '__return_false' );

<10

Ensure Webfont is Loaded

add_filter( 'elementor_pro/custom_fonts/font_display', function( $current_value, $font_family, $data ) { return 'swap'; }, 10, 3 );

<10

Remove Google Fonts

add_filter( 'elementor/frontend/print_google_fonts', '__return_false' );

<10