Allow SVG Files Upload (copy)

/** * Allow SVG uploads for administrator users. * * @param array $upload_mimes Allowed mime types. * * @return mixed */ add_filter( ‘upload_mimes’, function ( $upload_mimes ) { // By default, only administrator users are allowed to add SVGs. //…Continue reading

Allow SVG Files Upload (copy)

/** * Allow SVG uploads for administrator users. * * @param array $upload_mimes Allowed mime types. * * @return mixed */ add_filter( ‘upload_mimes’, function ( $upload_mimes ) { // By default, only administrator users are allowed to add SVGs. //…Continue reading

Current date

// Shortcode to display current Date add_shortcode(‘cl_date’, function() { // Format: “January 7, 2026” return date(‘F j, Y’); }); // Shortcode to display current Year add_shortcode(‘cl_year’, function() { // Format: “2026” return date_i18n(‘Y’); }); // Shortcode to display current Time…Continue reading

ACF option field shortcode

function acf_option_field_shortcode( $atts ) { // Definimos los atributos por defecto (solo necesitamos ‘field’) $atts = shortcode_atts( array( ‘field’ => ”, // Clave del campo a obtener ), $atts, ‘opcion_acf’ ); // Aseguramos que se ha proporcionado un nombre de…Continue reading

RankMath – Remove All Default Schema (Prevent Duplicates)

add_filter( ‘rank_math/json_ld’, function( $data, $jsonld ) { if ( isset( $data[‘publisher’] ) ) { unset( $data[‘publisher’] ); } unset( $data[‘WebPage’] ); unset( $data[‘ProfilePage’] ); unset( $data[‘place’] ); unset( $data[‘WebSite’] ); unset( $data[‘primaryImage’] ); return $data; }, 99, 2 );Continue reading

Fully Disable Comments & Trackbacks (The “Nuclear” Option)

/** * Fully Disable Comments & Trackbacks (The “Nuclear” Option) * Optimized for performance and UI clarity. */ add_action(‘admin_init’, function () { global $pagenow; if ($pagenow === ‘edit-comments.php’) { wp_safe_redirect(admin_url()); exit; } remove_meta_box(‘dashboard_recent_comments’, ‘dashboard’, ‘normal’); foreach (get_post_types() as $post_type) {…Continue reading

Disable Unused Auto-Generated Image Sizes

/** * Disable Unused Auto-Generated Image Sizes * Optimized for AWS Storage savings & Performance. */ add_filter(‘intermediate_image_sizes_advanced’, function ($sizes) { // Standard sizes often needed by Bricks/Kadence – Leave un-commented if needed // unset($sizes[‘thumbnail’]); // unset($sizes[‘medium’]); // unset($sizes[‘large’]); // High-bloat…Continue reading

Elementor LCP Image Preloader

/** * Elementor LCP Background Image Preloader v2.1 * * Extracts the EXACT URL from Elementor’s _elementor_data JSON * This ensures the preloaded URL matches what Elementor’s CSS requests * * WPCODE SETUP: * – Code Type: PHP Snippet *…Continue reading