Posts

Showing posts from December, 2023

add noindex nofollow to category archive

add_filter('wp_robots', 'add_noindex_nofollow_to_category_archive'); function add_noindex_nofollow_to_category_archive($robots) { if (is_category()) { unset($robots['max-image-preview']); $robots['noindex'] = true; $robots['nofollow'] = true; } return $robots; }

Disable WordPress dashboard for all but administrators.

function disable_dashboard() { if (!is_user_logged_in()) { return null; } if ( is_admin() && !defined('DOING_AJAX') && current_user_can('subscriber')) { wp_redirect(home_url()); exit; } } add_action('admin_init', 'disable_dashboard');

Disable WYSIWYG

add_action('init', 'init_remove_support',100); function init_remove_support(){ remove_post_type_support( 'post', 'editor'); }