Type: php
function – Disable Comments Completely
add_action(‘admin_init’, function () { // Redirect any user trying to access comments page global $pagenow; if ($pagenow === ‘edit-comments.php’) { wp_safe_redirect(admin_url()); exit; } // Remove comments metabox from dashboard remove_meta_box(‘dashboard_recent_comments’, ‘dashboard’, ‘normal’); // Disable support for comments and trackbacks in…Continue reading
admin – plugin – wpcode – Header
add_action( ‘admin_head’, function() { // Add CSS code below. ?> .wpcode-header-top {display:none;} <?php });Continue reading
admin – plugin – wphave – backend background color
add_action( ‘admin_head’, function() { // Add CSS code below. ?> /* background color */ .wpat #wpwrap {background: #F5F5F7;} /* wphave submenu arrow */ body.wpat.wpat-menu-left-expand #adminmenu li.wp-has-submenu a.menu-top .wp-menu-name:before {display:none;} <?php });Continue reading
Empty Admin Dashboard
add_action( ‘wp_dashboard_setup’, function () { global $wp_meta_boxes; $wp_meta_boxes[‘dashboard’] = array(); remove_action( ‘welcome_panel’, ‘wp_welcome_panel’ ); }, 1000 );Continue reading
Disable Plugin & Theme Editor
// Disable the Plugin and Theme Editor if ( ! defined( ‘DISALLOW_FILE_EDIT’ ) ) { define( ‘DISALLOW_FILE_EDIT’, true ); }Continue reading
Disable WordPress Sitemaps
add_filter(‘wp_sitemaps_enabled’, ‘__return_false’);Continue reading
Disable Site Health
// Remove Tools Submenu Item for Site Health. add_action( ‘admin_menu’, function () { remove_submenu_page( ‘tools.php’, ‘site-health.php’ ); } ); // Prevent direct access to the Site Health page. add_action( ‘current_screen’, function () { $screen = get_current_screen(); if ( ‘site-health’ ===…Continue reading
Disable Lazy Load
add_filter( ‘wp_lazy_loading_enabled’, ‘__return_false’ );Continue reading
Dynamic Year Copyright Shortcode
// Copy the Shortcode in the Insertion box below and paste it wherever you want the copyright symbol + year to be displayed. // This will output © 2023 or the current year automatically. echo “© ” . date( ‘Y’…Continue reading