you don’t need any plugin.just add this code to your function.php file which you will find in your theme folder.
add_action( 'init', 'blockusers_init' );
function blockusers_init() {
if ( is_admin() && current_user_can( 'subscriber' ) ) {
wp_redirect( home_url() );
exit;
}
}
Related Posts:
- Override WordPress user with Oauth2 account
- How can I delete orphan keys in WordPress database tables?
- Custom Filter in WordPress to modify footer information via plugin?
- Is it heavyweight plugins or lots of plugins that make a site slow?
- Why does wp_enqueue_style() in plugin not load stylesheet?
- Archive list with only years and months
- Admin plugin, how can I output a different content-type?
- Editor access to plugin settings
- Network-Wide Plugin Settings Management
- Has anyone been able to get the aweber plugin to work
- Use Media Uploader in Plugin
- wp_nav_menu(); Outside WordPress installation
- Install plugin remotely
- Woocommerce: Changing the variations select default value? [closed]
- Best Apache Log Analyzer Plugin? [closed]
- Star rating for custom post types [closed]
- How to Make a Custom Grid View
- Extend the Admin Post/Edit page
- How WordPress knows where to find locale files?
- Can wp_script_is used in pluginA check if a script is being enqueued/registered from pluginB?
- Reuse javascripts from plugins within the theme
- WP theme with Backbone
- $wpdb working with ajax but showing ajax error instead of success
- Inserting large amounts of data into a custom table during plugin install
- WP-Markdown treating java generics like HTML tags
- Can’t get title of latest post
- Display success message after wp_update_post
- Global variables during plugin activation , deactivation and uninstall operarations
- Need help restoring my WordPress blog
- White page on custom plugin option submit
- Image upload and other options in the same plugin settings form?
- “Request has expired” with “Make your site social” (Gigya) plugin
- WordPress display breadcrumbs using Yoast plugin [closed]
- How to change this WP_Query to get all ProductIDs and not only specific one?
- WordPress plugin output formatting
- Finding which plugin uses cloudflare (due to GDPR)
- Automatically Assign Author to Category [closed]
- How can I change the meta_key for a particular piece of information?
- WordPress “Categories to tags converter” not working. Pointing to import.php instead
- the_tags : can we insert a class
- Elementor: How to override global theme style settings? [closed]
- Add user role to generated plugin
- Modify page title and subtitle with a plugin
- override filter in a plugin
- How to load different homepage on Mobile.?
- Hook into the rendering of a WordPress Template
- Setting Email locale before retrieving gettext translations
- Is there a maximum length to a WordPress Page?
- I changed .live() to .on() but change is not reflected on the server
- Save user total active time after login in wordpress [closed]
- How to track analytics with a WordPress site under the same domain as my main site?
- Plugin to reformat the post automatically after submitting
- Submit plugin for review
- Calling a save function from a “submit” button
- Add a “default sorting” menu to child store pages
- How to hook into action/filter call
- Select Form Element Not Saving from Plugin Options
- Does WordPress send data about your blog back to Automattic or somewhere else? [duplicate]
- Plugin to create unlimited custom shortcodes?
- How do I create pages within a WordPress post?
- Gutenberg default attributes are empty when accessing in edit
- Ajax 400 error when used inside a plugin
- How to add custom plugin data to the cart in woocommerce using custom button on product page?
- How can I display selected content from a seperate database in an Activity style widget?
- how to show all posts of each category in pages
- Error thrown Call to a member function get() on null
- Allowed memory size of 134217728 … wp-includes/wp-db.php on line 1989
- Pricing Calculator – WordPress
- reminder wp_schedule_event
- Undefined offset: 0 in WordPress after latest version upgrade [closed]
- Make the product page as homepage WooCommerce
- Adding shortcodes to multiple pages with function
- Genesis Child Theme – Customize body
- Media Dialog CSS broken in WP v.5.3.2
- Multiple wordpress installations with same plugin folder (Apache Virtualhost)
- Slide through page effect?
- Get a list of Product Categories inside a loop
- Suspect incomplete .pot file – what to do?
- Can you develop themes and plugins while using the hosting services BlueHost? [closed]
- Google analytic issue in wordpress
- How to update plugins in a distributed wordpress scenario?
- What’s the preferred method of writing AJAX-enabled plugins?
- WordPress API hook
- jquery conflict with widget page
- Automatically add child pages to menu
- Infinite Scroll plugin scrolling truly “infinitely” (i.e. does not recognize end of posts)
- Simple Data Table Update and Page Integration
- How to add a box for list items?
- wp_update_post call really slow when official Facebook plugin is installed
- Simply Exclude – Category feed exclusion is excluding from category feed instead of just the main feed
- Woocommerce custom fields
- This plugin throws error on the events page only [closed]
- White Screen When Includding A Folder With PHP Files
- making a simple plugin
- How to make temporary expiring link for a downloadable file
- Custom single-product page for product from category x
- edit slider plugin capability for custom_role
- Plugin Block at the backend of every page or post
- Custom Login and Password Reset for BuddyPress Website
- How to add a react element into the DOM node (only on the user-interaction like on click) without using the state?