Yumea

How to Hide Your WordPress Login Page Without a Plugin

Yumea·

WordPress is a very popular CMS. It is used today by tens of millions of people, and that figure continues to grow. It is therefore no secret that the default login page can be easily identified via wp-admin, or wp-login.php. Hiding the login page of your WordPress site can be done with the help of various plugins. But it is also possible to do it manually, like a true pro! Here is how:

Hackers use various methods to break into and attack your WordPress site, in particular brute force attacks. This method involves accessing your site using your login password. And since many threats exploit your plugins to undermine your work, it is recommended to manually hide the login page on WordPress.

If you receive too many HTTP requests, the effect is similar to an invasion of zombie-robot armies. You risk gradually running out of memory and considerably slowing down the loading of your WordPress site, which can be a real annoyance for your visitors. But first and foremost, remember to back up your files and delete any unnecessary or inactive plugins. Never trust a directory you cannot delete, or a computer from which you cannot extract the window.

Manually Creating a New PHP Login File

By default, the wp-login.php file contains the code that generates the login sequence and page. It is possible to use the wp-login.php code in a new file — an effective way to change the name of your file.

This will also allow you to change the login URL. All you need to do is access your site's files and a text editor, such as NotePad++

5 Steps to Manually Hide Your WordPress Login Page

1. Create a new file

Create a new file from the text editor and save it in your root folder. Name this file according to your chosen login URL name (for example: new-login.php).

2. Copy and paste the code

Once the file is created, open wp-login.php, select the code and copy it, then paste it into your new file. Do not forget to save it.

3. Find and replace the "wp-login.php" file

Now find and replace every instance of "wp-login.php" in the file and replace it with your new name. Notepad++ has a find-and-replace function you can use to find each instance of "wp-login" and replace it quickly.

4. Delete the wp-login.php file

Once your changes are saved, you can delete the wp-login.php file.

5. Test your new login URL

You should now be able to log in by navigating to your new URL. For example, for a test case X, the typical path would be: localhost/test/wordpress/new-login.php. All HTTP requests to /wp-login.php or /wp-admin directories will lead visitors to a page-not-found error.

URL Redirection

You can use URL redirection to hide your login page without a plugin. On an Apache server, the module used is called mod_rewrite, which manipulates the URLs of your WordPress site. This may sound complex, but this approach allows an almost infinite number of tasks to be performed, such as creating an alias for the wp-login.php page.

This method is less about your site's security and more about how the URL appears in the address bar. To change the name of the login URL, here is the code to add to your .htaccess file:

RewriteRule ^ mynewlogin $ http://www.yoursite.com/wp-login.php [NC, L]

You can now access the admin URL from http://www.yoursite.com/mynewlogin. Bear in mind that this does not prevent users from going to the wp-login.php page directly. It simply allows them to log in from a different URL.

Why Prefer the Manual Approach Over Plugins to Hide Your WordPress Login Page?

There are good reasons why using a plugin to hide your login URL can be the right choice. However, manually creating a new login path will not cause you problems with future updates.

With plugins, you may encounter compatibility issues with those that contain code referencing wp-login.php. But be careful when modifying your core, as some issues can arise. That said, this does not mean that using plugins for this purpose is in any way forbidden or inadvisable. There are plenty of reliable ones that can do the job for you free of charge.

Source: Elegantthemes.com

YOU MAY ALSO LIKE

UGC, the Future of Marketing: How User-Generated Content Can Revolutionise Your Marketing Strategy

by Yumea, 7 March 2023

UGC (User Generated Content) is changing the game in the world of marketing. With the rise of social media and content-sharing platforms, the ... READ MORE

Category: News , Getting Visible Online , Social Media

Comments: 0

How to Use Instagram to Reach Your Audience and Drive Traffic to Your Website

by Yumea, 1 February 2023

Social media has become an indispensable tool for businesses looking to reach their target audience and drive traffic to their website. With more than 3.8 billion active users ... READ MORE

Category: Getting Visible Online , Instagram , Social Media

Comments: 0

7 Artificial Intelligence (AI) Tools You Need to Know in 2023

by Yumea, 12 January 2023

In 2023, there are many websites that use artificial intelligence (AI) to help users write content and generate images. If you are looking for tools to help you write ... READ MORE

Category: News

Comments: 0

Have a similar project?

Let's talk it over in 15 minutes. No sales pitch, just a technical chat.