SVG upload for WP Admin only

/** * Enable SVG uploads for Administrators only */ function enable_svg_uploads_for_admins($mime_types) { if (current_user_can(‘manage_options’)) { $mime_types[‘svg’] = ‘image/svg+xml’; $mime_types[‘svgz’] = ‘image/svg+xml’; } return $mime_types; } add_filter(‘upload_mimes’, ‘enable_svg_uploads_for_admins’); /** * Bypass secondary file-type check for SVG uploads by admins */ function…Continue reading

Schema Single Post

// Schema Single Post / Kiri Vadivelu / 2026 add_action(‘wp_head’, ‘schema_single_post’); function schema_single_post() { if ( ! is_single() ) return; $schema = [ ‘@context’ => ‘https://schema.org’, ‘@type’ => ‘Article’, ‘headline’ => get_the_title(), ‘author’ => [‘@type’ => ‘Person’, ‘name’ => get_the_author()],…Continue reading

Open Graph Meta

// Open Graph Meta / Kiri Vadivelu / 2026 function open_graph_meta() { if (is_singular()) { global $post; $title = get_the_title(); $description = has_excerpt() ? get_the_excerpt() : wp_trim_words($post->post_content, 30); $url = get_permalink(); $image = get_the_post_thumbnail_url($post->ID, ‘large’); $site_name = get_bloginfo(‘name’); echo ‘‘…Continue reading

Remove Admin Help

// Remove Admin Help / Kiri Vadivelu / 2026 add_action( ‘admin_head’, ‘remove_admin_help_tabs’ ); function remove_admin_help_tabs() { $screen = get_current_screen(); if ( $screen ) { $screen->remove_help_tabs(); } }Continue reading

Custom Screen Option

// Custom Screen Option / Kiri Vadivelu / 2026 function custom_screen_option() { if ( get_current_user_id() !== 1 ) { // Replace your ID return false; } return true; } add_filter( ‘screen_options_show_screen’, ‘custom_screen_option’ );Continue reading

Remove Dashboard Widget

// Remove Dashboard Widget / Kiri Vadivelu / 2026 add_action( ‘wp_dashboard_setup’, ‘remove_dashboard_widget’ ); function remove_dashboard_widget() { // Remove specific widgets by their ID and section remove_meta_box( ‘dashboard_right_now’, ‘dashboard’, ‘normal’ ); // At a Glance remove_meta_box( ‘dashboard_activity’, ‘dashboard’, ‘normal’ ); //…Continue reading

Contributor Default Role

// Contributor Default Role / Kiri Vadivelu / 2026 function contributor_default_role( $default_role ) { return ‘contributor’; // Replace your choice } add_filter( ‘pre_option_default_role’, ‘contributor_default_role’ );Continue reading

test

add_action( ‘admin_notices’, function () { $state = ( defined( ‘WP_DEBUG’ ) && WP_DEBUG ) ? ‘enabled’ : ‘disabled’; echo ‘ WP_DEBUG is ‘ . esc_html( $state ) . ‘. ‘; } );Continue reading