Type: php
Disable XML-RPC
add_filter( ‘xmlrpc_enabled’, ‘__return_false’ );Continue reading
Completely Disable Comments
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
Remove users from WP-JSON
add_filter(‘rest_endpoints’, function( $endpoints ) { if ( isset( $endpoints[‘/wp/v2/users’] ) ) { unset( $endpoints[‘/wp/v2/users’] ); } if ( isset( $endpoints[‘/wp/v2/users/(?P[\d]+)’] ) ) { unset( $endpoints[‘/wp/v2/users/(?P[\d]+)’] ); } return $endpoints; });Continue reading
Remove WordPress Version Number
add_filter(‘the_generator’, ‘__return_empty_string’);Continue reading
Scroll Progress Bar
add_action(‘wp_body_open’, function() { echo ‘ ‘; }); add_action(‘wp_head’, function() { echo ‘ ‘; }); add_action(‘wp_footer’, function() { echo ‘‘; });Continue reading
Remove Dashboard Welcome Panel
add_action( ‘admin_init’, function () { remove_action( ‘welcome_panel’, ‘wp_welcome_panel’ ); } );Continue reading
Remove “WordPress” from admin titles
add_filter( ‘admin_title’, function ( $admin_title, $title ) { return str_replace( ” — WordPress”, ”, $admin_title ); }, 10, 2 );Continue reading
Last Login Column
// Please note: This snippet will only show the last login date & time AFTER the snippet is activated. // The snippet has to be active to track the last login date & time. // Add a column to the…Continue reading
Disable Plugin & Theme Editor
// Disable the Plugin and Theme Editor if ( ! defined( ‘DISALLOW_FILE_EDIT’ ) ) { define( ‘DISALLOW_FILE_EDIT’, true ); }Continue reading