Short Breadcrumb Title

.wp-block-breadcrumbs ol li:last-child { max-width: 175px; /* Set desired limit */ white-space: nowrap; /* Prevents line breaks */ overflow: hidden; /* Hides text exceeding width */ text-overflow: ellipsis; /* Adds the “…” dots */ display: inline-block; }Continue reading

Auto Admin Logout

// Auto Admin Logout / Kiri Vadivelu / 2026 add_filter( ‘auth_cookie_expiration’, ‘short_session_admin’, 10, 3 ); function short_session_admin( $expiration, $user_id, $remember ) { // Only apply the short timeout for administrators if ( user_can( $user_id, ‘manage_options’ ) ) { return 3600;…Continue reading

Sticky Tag Post

// Sticky Tag Post / Kiri Vadivelu / 2026 add_action(‘pre_get_posts’, function($query) { if (!is_admin() && $query->is_main_query() && is_tag()) { $sticky_posts = get_option(‘sticky_posts’); if (!empty($sticky_posts)) { add_filter(‘posts_orderby’, function($orderby, $query) use ($sticky_posts) { if (!is_admin() && $query->is_main_query() && is_tag()) { global $wpdb;…Continue reading

Restrict WP Heartbeat

// Restrict WP Heartbeat / Kiri Vadivelu / 2026 add_action( ‘init’, function() { if ( ! is_admin() ) { wp_deregister_script( ‘heartbeat’ ); // Disable heartbeat in frontend } }); add_filter( ‘heartbeat_settings’, function( $settings ) { $settings[‘interval’] = 60; // Set…Continue reading

Sensitive User Switch

// Sensitive User Switch / Kiri Vadivelu / 2026 add_filter( ‘user_has_cap’, function( $allcaps, $caps, $args, $user ) { if ( ‘switch_to_user’ === $args[0] ) { // Deny switching to everyone except site owner if ( $user->user_login !== ‘ownerusername’ ) {…Continue reading

Sensitive Site Setting

// Remove Sensitive Setting / Kiri Vadivelu / 2026 add_action( ‘admin_init’, ‘remove_sensitive_setting’, 999 ); function remove_sensitive_setting() { global $user_ID; if ( $user_ID != 1 ) { // Primary Menus remove_menu_page( ‘options-general.php’ ); // Settings // Secondary Menus remove_submenu_page( ‘themes.php’, ‘site-editor.php’…Continue reading