Disable Plugin & Theme Editor
// Disable the Plugin and Theme Editor if ( ! defined( ‘DISALLOW_FILE_EDIT’ ) ) { define( ‘DISALLOW_FILE_EDIT’, true ); }Continue reading
Join 2,000,000+ Professionals who use WPCode to Future-Proof Their Websites!
// Disable the Plugin and Theme Editor if ( ! defined( ‘DISALLOW_FILE_EDIT’ ) ) { define( ‘DISALLOW_FILE_EDIT’, true ); }Continue reading
// Disable Yoast SEO HTML Comments add_filter(‘wpseo_debug_markers’, ‘__return_false’); // Disable XML-RPC add_filter(‘xmlrpc_enabled’, ‘__return_false’); // Remove WordPress Version Number add_filter(‘the_generator’, ‘__return_empty_string’); // Disable Plugin & Theme Editor if (!defined(‘DISALLOW_FILE_EDIT’)) { define(‘DISALLOW_FILE_EDIT’, true); } // Disable Author Archives add_action(‘template_redirect’, function(){ global $wp_query;…Continue reading
// disable gutenberg frontend styles @ https://m0n.co/15 function disable_gutenberg_wp_enqueue_scripts() { wp_dequeue_style(‘wp-block-library’); wp_dequeue_style(‘wp-block-library-theme’); wp_dequeue_style(‘global-styles’); wp_dequeue_style(‘classic-theme-styles’); } add_filter(‘wp_enqueue_scripts’, ‘disable_gutenberg_wp_enqueue_scripts’, 100);Continue reading
// Remove side menu add_action( ‘admin_menu’, function () { remove_menu_page( ‘edit.php’ ); } ); // Remove +New post in top Admin Menu Bar add_action( ‘admin_bar_menu’, function ( $wp_admin_bar ) { $wp_admin_bar->remove_node( ‘new-post’ ); }, 999 ); // Remove Quick Draft…Continue reading
// Disable core auto-updates add_filter( ‘auto_update_core’, ‘__return_false’ ); // Disa add_filter( ‘auto_update_theme’,Continue reading
function disable_all_admin_notices() { remove_all_actions(‘admin_notices’); } add_action(‘admin_init’, ‘disable_all_admin_notices’);Continue reading
function exclude_pages_from_search($query) { if ($query->is_search) { $query->set(‘post_type’, ‘post’); // Exclude pages by changing ‘post’ to ‘page’ } return $query; } add_filter(‘pre_get_posts’,’exclude_pages_from_search’);Continue reading
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
.woocommerce-cart .cross-sells {display:none;}Continue reading
// Disable the Plugin and Theme Editor if ( ! defined( ‘DISALLOW_FILE_EDIT’ ) ) { define( ‘DISALLOW_FILE_EDIT’, true ); }Continue reading