Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

Remove default user registration, login and subscriber profiles

I realised this is probably better dealt by the server, I ended up putting the following in a .htaccess:

# Block regular login/registration and profile pages
<Files wp-login.php>
    Order Deny,Allow
    Deny from All
</Files>
<Files profile.php>
    Order Deny,Allow
    Deny from All
</Files>

This prevents any requests to those pages and forces users to use my custom login and registration pages.

Edit: I don’t think I made this clear and I do not recommend this solution to most WordPress users.

I have a custom user registration, login and profile system. These do not extend the default WordPress ones but are completely stand-alone and do not require access to these pages as all logic and requests are handled by the system itself and not passed on (However they do use WordPress functions and the default user table in the WordPress database).

This is not the same as say a plugin which provides a custom login page just to change the theme but actually sends POST requests back to wp-login.php as this would break under my solution.

Related Posts:

  1. Registration Hooks don’t appear to be working
  2. Unable to login after registration
  3. wp_enqueue_script was called incorrectly
  4. Add multiple custom fields to the general settings page
  5. Adding fields to the “Add New User” screen in the dashboard
  6. How to add first name & last name to default registration form?
  7. Masking logout URL
  8. How can I tell if I’m on a login page? [duplicate]
  9. Is it possible to use a forgot password url filter?
  10. Create new user without password
  11. How to display error messages using WP_Error class?
  12. redirect wp-login.php to another page
  13. How to override WordPress registration and insert an auto-generated username?
  14. Login using the password from protected pages
  15. Restrict user registration to emails on a single domain
  16. How do I redirect upon login a specific user based on role?
  17. Logging in redirects to correct page but shows logged out content until forced refresh
  18. WordPress registration and contact form 7 [closed]
  19. Custom registration URL lost when user makes signup mistake
  20. is_user_logged_in not working to redirect only logged out users
  21. Members only site – still need the lost password page accessible
  22. How to add custom fields to my custom registration form
  23. How to change login labels
  24. Display alert on successful user Sign Up
  25. How can I get my Script to work on the Login page?
  26. Login Redirect if Logged in from Specific Page
  27. Unable to login using username
  28. Change label for registration Fields
  29. When a user logs in, how can they view the website instead of the admin menu?
  30. WordPress PHP Conflicting User Sessions
  31. Get User Login Data (date, time… )
  32. Multisite 404 on pages – rewrite error breaks database
  33. Trying to register script in footer
  34. If user is logged-in display/hide something
  35. Is there a way to direct unregistered user to registration page when click a link?
  36. Secondary Menu and Logged In Users
  37. Adding additional roles on registration
  38. Prevent WordPress Automatic Logout
  39. error at login page in wordpress
  40. Add Login/Logout Menu Item to Primary Nav “My Account” Submenu [Woocommerce] [closed]
  41. Logout Redirect and also WP-login.php Redirect
  42. loginout function customization
  43. call wp_insert_user in custom class doesnt work
  44. How to setup a popup registeration page in wordpress with function.php
  45. Add Login and logout buttons to top menu bar
  46. Show errormessages on wrong username/password on custom loginform?
  47. WordPress login set cookie that survive browser exit (wp_signon function)
  48. WordPress comment processing . Default unapproved comments detection before posting
  49. This code is supposed to only allow user to be authenticated if accountVerified is equal to 1, but it still allows user to be authenticated otherwise
  50. Prevent wp_signon redirect on failed login for ajax login
  51. How to redirect Subscribers on login to specific page, when logging in from a Page
  52. How to replace ACTION url from original wordpress login form?
  53. Allow user select role in wordpress default registration without plugin
  54. Allow logged in user to view a Page, else send to login screen and then redirect back to Page
  55. How can I automatically delete comments that contain a URL?
  56. Set display name from nickname with register process
  57. Redirect after login to current URL
  58. Restrict certain roles registrations by domain
  59. Changing the register url is not working
  60. Login functions
  61. WordPress permanently logging users out
  62. Problem in outputting shortcode
  63. Problem in shortcode outputting content
  64. Mail function not working with user accounts
  65. Register a widget area when a theme option has been saved?
  66. How to request login for user but not for bots
  67. is_user_logged_in() isn’t working
  68. update_user_option not working as expected
  69. “Headers already sent” while trying to add a CSS file to my login page?
  70. Help finishing script to export WP user data when form submitted
  71. Simple way to make most of my site private
  72. wp_login_form display no styled form
  73. Redirecting after login except for a specific page
  74. How to require a config file in a template and in function.php?
  75. Adding custom social icons to the social media icon block in the Gutenberg editor?
  76. the_date() and the_time() functions display actual date an time instead of published date and time
  77. remove edit link only for published post and pending post
  78. How to add extra value to permalink
  79. Pass URL to iframe in WordPress Block
  80. Load templates, pass arguments, and render output from functions.php
  81. How do I make the comment disappear after deleting from the database?
  82. Change Page Title
  83. Bulk updating a group of WordPress Pages every 10 minutes
  84. How to add if statement on WordPress shortcode output
  85. How to Not Show posts on Category page?
  86. Passing function arguments via a shortcode
  87. Malfunction via Safari [closed]
  88. How to load a css file depending on the current role
  89. Is it possible to limit number of files a non-admin user can upload via the WordPress media library?
  90. localize_script but data changes dependent on product ID
  91. Auto delete content in specific folder inside media library
  92. How to change images url in function.php?
  93. Using get_terms for custom taxonomy in functions.php
  94. How can I connect to a second database and still be able to use wp functions like get_post_types()?
  95. Display Script in Header When URL Variable Present
  96. Redirect to one of two pages after data submitted, depending on the current url
  97. Which filter fires upon setting a featured image
  98. Change category display name function
  99. Render metabox gallery in frontend
  100. WordPress wp_dequeue_script remove all other scripts
Categories functions Tags functions, login, spam, user-registration
How to change style of Disqus comment count on main page
Is there a hook to process a backbone restful PUT request inside wordpress?

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 2026 Read For Learn
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress