By Killing WP on non-admin Pages
The below code will determine whether you are on a front-end page or not, and kill WP if you are.
add_action( 'init', 'my_function' );
function my_function(){
if ( ! is_admin() ) wp_die();
}
Note that this might also affect AJAX requests ( untested ) so you might want to add wp_doing_ajax()
to your conditional too.
By Redirecting the Users to Dashboard
Same as above, you can check if you are on admin and redirect the users to back-end from front-end.
add_action( 'init', 'my_function' );
function my_function(){
if ( ! is_admin() ) {
wp_safe_redirect( admin_url() );
exit();
}
}
By Creating an Empty Theme
Create a blank theme, and only add index.php
and style.css
as its content. Now you can activate the theme, and everyone visiting the front-end will be getting a white page.
Related Posts:
- How to Layer 7 Load Balance WordPress Backend and Frontend?
- WordPress Error establishing a database connection For Admin login only
- How to use Yoast SEO backend in english even if WPLANG variable is not english?
- Why are my frontend theme styles bleeding into the backend?
- How to make the front-end RTL without changing the admin panel language?
- Admin menu in front-end
- is_admin() conditional statement
- plugin: ‘init’ hook, check if we’re not in admin
- Redirect users based on their roles, is_admin()
- adding the category to the admin column for a custom post type?
- Change page title in admin area
- How to filter by post-format in admin?
- Make fonts.com font work in TinyMCE (iframe referrer issue)
- How to remove the site health dashboard widget?
- Securing wp-admin folder – Purpose? Importance?
- stop redirection on /wp-admin call to /wp-login
- Users are redirected to homepage instead of wp-admin
- How to show an error message after publishing a post?
- Set “Display name publicly as” to be usernames by default
- Is there a way to submit only meta box content in Post edit page
- Moving wordpress from localhost to server throws admin panel access error?
- How to disable admin flyout menus?
- WordPress custom permalinks not working on OS X localhost
- 500 Internal Server Error after Register dialog, but with successful registration
- How to hide a specific user role option in a user role list?
- Block access to wp-admin
- How could I execute my plugin just in frontend (not in backend)
- CDN + WP Admin Query – .htaccess redirection
- Users Unable to Access Dashboard/Posts/Pages
- Stop loading “collaborators” users on add new post or page?
- Prevent /wp-admin/ from redirecting to homepage?
- Disable the administration email address verification (new in 5.3)
- https://mydomain/wp-admin redirects to wp-login.php?redirect_to=https%3A%2F%2Fmydomain%2Fwp-admin%2F&reauth=1
- Password reset link becomes invalid immediately [closed]
- Get which template being in use within WordPress-admin
- special characters after saving draft interpreted as �
- WordPress and bbPress Login conflicts?
- Allow administrators to pick post author on custom post type edit screen
- /wp-admin/ works but website doesn’t load
- How can I use a variable to include a linked image?
- Add css code in admin_enqueue_scripts
- Add custom list menu on Posts page in admin panel
- Does it matter if two people are using the same WordPress admin account?
- Add column to pages table
- Use Password Protected Form without the use of wp-login.php
- redirect to a dedicated sign in page
- My email address is displaying an email which does not work. What do i do?
- More than one admin logged in?
- Too many redirects after added SSL redirect on port 80 virtual host
- Register page in admin area
- Downgrade admin account by mistake
- Removing Dashboard Menu Items Through The Database
- “WordPress installations is currently out of date” problem with difficult situation [closed]
- Custom plugin admin page issues
- Making Comments, a sub_menu in admin menu
- Without using wordpress cms Is it possible to signup from my html page
- Customising Word press Admin – Add Post Page functionality to another similar page
- How to add ‘Insert HTML Table’ button to TinyMCE in admin?
- How to allow WordPress updates to only one specific administrator?
- How can I remove commas when adding tags?
- Displaying Title in Title Tag on Edit page?
- How to add custom CSS and JavaScript file for wp- admin dashboard (backend)
- GoDaddy hosting wp-admin problem
- How can I remove unwanted word on my WP site?
- How to take the help button and link off the dashboard
- Newly created user role not displaying on users screen
- issue with wordpress [wp-admin] redirects, when using kubernetes ingress hosting two wordpress websites using path
- Toggle between block ‘edit content’ and ‘select’ not properly working in WordPress Admin
- WordPress Admin extremely slow when other admin logged in
- Can’t acces login on new site
- WordPress Admin Panel Left Sidebar No showing on Post create page
- WordPress Migration Post Problems
- After changing Site http to https, can’t access wp login page with a digitalocean hosting
- Can’t access WP-Admin via HTTPS
- wp-admin and wp-login.php not Accessible after Cloudflare
- adding existing menu page on new customer user role
- stop customize.php redirect to login page if admin is not logged in
- Random authentication failures on a load balanced WP setup
- Can I get programmatic access to wp-admin?
- Strange URLs admin area bug
- remove_query_arg on options.php
- wp.svgPainter cannot init error, causing issues with admin panel
- mysql_escape_string PROBLEM
- Cannot access my wordpress website
- Organising and display thousands of photos in media library
- Custom comment action
- Get URL of current featured image with JS in edit post view
- get_current_screen – ‘Trying to get property of non-object’ error
- Added fields in quick edit screen need to update at the moment
- Block tools menu in wp-admin?
- is_admin() triggers error
- WordPress Admin: open popup window on a custom button
- Modify admin panel tab position
- not able to add thumbnail custom field in dropdown
- No wp-admin, wp-config, or .htaccess folder/file
- WordPress blog fails to open
- wordpress admin is broken [closed]
- Redirecting the user to the admin table area after publishing a post, getting an invalid response error?
- How can you change the admin dashboard URL without symlinking?
- Degraded WordPress admin dashboard performance [closed]