How to Create a Powerful and Secure Customized Firewall with Defender

Featured Imgs 13

Hackers can be persistent at trying to get into your site and drop malicious code, figuring out your credentials, and leaving spam. Thankfully, with WPMU DEV’s 5-star security plugin, Defender, you can set up a firewall, block IP addresses with customized lists, and more…leaving troublemakers unable to take even the first step into your WordPress site.

This tutorial will demonstrate how easy it is to set up Defender’s IP banning and keep your WordPress site safe.

Here are 8 areas we’ll be covering (jump to a specific topic by clicking on it):

  1. Automatically Identify Bad Acting IP Addresses
  2. Creating a Custom Blocklist & Allowlist
  3. Active Lockout Displays
  4. Unlocking IP Addresses
  5. Location Banning
  6. Creating Custom Message for Banned Users
  7. Importing and Exporting Custom Blocklist & Allowlist
  8. Check Your Lockout Log for Suspicious Activity

Most areas of this tutorial are accessible in Defender under the Firewall and IP Banning section unless specified differently.

Let’s get started with the best and most powerful feature of Defender’s firewall…

1. Automatically Identify Bad Acting IP Addresses

Defender automatically identifies bad acting IP addresses and adds them to a firewall, providing your site with ongoing security and protection.

You can lock out users who attempt a number of failed login attempts. Defender gives you control over the threshold and duration of the lockout in the Login Protection screen (Defender > Firewall > Login Protection).

Defender Login Protection screen.
Defender lets you set how many failed login attempts will trigger a lockout for a user’s IP address.

You can view how many IP addresses have been temporarily blocked in the Active Lockouts section of the IP Banning screen (Defender > Firewall > IP Banning > Active Lockouts). You can also unblock IP addresses here.

Defender Active Lockouts
View and release temporarily blocked IP addresses in the Active Lockouts section.

You can also enable 404 detection (Defender > Firewall > 404 Detection), and Defender will automatically block IP addresses that repeatedly request pages on your website that don’t exist. It will also temporarily block these offending IP addresses from accessing your site.

Defender 404 Detection
Defender’s 404 detection blocks IP addresses that repeatedly request pages on your site that don’t exist.

Tip: You can use the 404 detection feature in combination with Defender’s login masking feature to immediately identify and block IP addresses requesting your site’s login page.

In addition to Defender’s automatic IP blocking features, you can also block IPs manually, as the next section explains.

2. Creating a Custom Blocklist & Allowlist

Creating a custom blocklist & allowlist with Defender will keep unwanted IPs from accessing your site.

It’s done by easily entering any IP addresses. This includes admins, too.

The first area is for your Blocklist.

The area to enter your blocklisted IPs.
The area to enter your blocklisted IPs.

You can type out any IPs you want to be blocked, and they’ll no longer be able to access your site.

When you scroll down a bit further, you’ll have the option to add IP addresses to your Allowlist.

The Allowlist area.
The Allowlist area.

It’s the same as the blocklist, where you just enter the IP addresses that you’d like to always have access to your WordPress site.

IPv4 and IPv6 are both supported for the blocklist and allowlist.

Note: We recommend adding your own IP to avoid getting locked out by accident. Your current IP address will be shown below the allowlist and you can easily copy and paste it in.

When you have all the information added to the blocklist and allowlist, there’s a Save Changes button at the bottom of the screen that will save everything.

Unwanted IPs are no longer going to be stopping by your WordPress site.

3.Active Lockout Displays

You can easily view any IP addresses that are blocked from accessing your site based on your rules.

Active lockouts screen.
Active lockouts screen.

Once you start having lockouts, they’ll all be compiled here. You can see how many IP addresses are currently blocked.

And if you need to unblock any IPs, there’s…

4. Unlocking IP Addresses

Sometimes an IP is blocked or banned and you need to unblock it for many reasons.

Defender makes it simple to release any IP addresses from the Active Lockout area by hitting the Unlock IPS button.

Unlock IPs area.
You can see there are 30 IP addresses currently blocked here.

This will reveal all of the blocked IP addresses and it’s one-click to unblock them by clicking Unblock.

Where you’ll unblock an IP address.
Where you’ll unblock an IP address.

There’s no need to hit anything further after this. It will unblock the IP and you’re all set.

You can also search for specific IPs in the search area if you’re having difficulty locating them on the list.

5. Location Banning

Along with IP addresses, you can also ban entire countries with Defender. This feature is handy when you don’t want or expect traffic from specific locations and want to put a stop to hackers and bots visiting from certain areas.

All of this can be achieved in the Locations section.

Defender works with a company called MaxMind, so it can have access to the GeoLite2 Database. It’s free to set up an account and will ask you to do so when first setting up location banning.

The Locations area. When you get started with Defender, it asks you to set up an account with MaxMind.
The Locations area. When you get started with Defender, it asks you to set up an account with MaxMind.

There are prompts for a free account. From there, they’ll email you steps to set up a password. Once you login in, you click the link for a new license key in Defender’s dashboard.

Create a new license key in MaxMind and then it will be ready to copy and paste into Defender.

Where a new key is produced.
Where a new key is produced.

Once your new license key is pasted, you’ll be all set once you hit the Download button. It may take a few minutes for the key to register, so keep that in mind.

Now you have the option to Blocklist & Allowlist any country.

There is a drop-down menu that displays them. Once you start typing, it will populate any corresponding countries that start with that letter.

The drop-down menu of countries. Select as many as you’d like to blocklist or allowlist.
The drop-down menu of countries. Select as many as you’d like to blocklist or allowlist.

They’ll all appear in the box below your choice of blocklist or allowlist. You can also take them off the list by clicking on the ‘X’ next to the country’s name.

Blocklist of countries.
List of the countries added so far.

When completed, it’s all saved by hitting the Save Changes button.

6. Creating Custom Messages for Banned Users

Give any locked out hacker a customized message from Defender himself. All of this can be done in the Message area.

You have the ability to add a customized message in this space.

Customized blocklist message.
Where you’ll type in a customized message.

And after that, anyone that is on the blocklist will be greeted by Defender.

A message from Defender.
Defender is here to tell them what’s happening.

After clicking the Save Changes button, the message will be functioning and unwelcome guests will know why they’re IP isn’t making the cut.

7. Importing and Exporting Blocklist & Allowlist

If you have a blocklist or allowlist from another website and want to import them, it’s quick and easy to do. Likewise, you can export your list that you have for blocklist and allowlist to use on another website.

All of this is under Import and Export in Defender.

Where you can import and export blocklist and allowlist.
Where you can import and export blocklist and allowlist.

There’s an Import button to import and Export button to export a list.

Importing will not remove existing IPs. Also, when you export, it will include the blocklist and allowlist.

8. Check Your Lockout Log for Suspicious Activity

You can view all of your lockouts and quickly ban, allowlist, or delete the list in just a couple of clicks. Plus, you can easily download your activity logs of IP lockouts.

This, unlike the previous sections, is located in Firewall and Logs on Defender’s dashboard.

Where you can view all of your lockout activity.
Where you can view all of your lockout activity.

Once here, you can sort logs by the latest, oldest, or IP address. You can also export them as a CSV and adjust the date range.

Where you can sort the logs.
Where you can sort the logs.

Also, take care of the issues in one-click with Bulk Update. You can ban, allowlist, or delete just by checking the boxes individually or by the dropdown to take care of them all.

Take care of things in bulk with the bulk update.
Take care of things in bulk with the bulk update.

You can also get more detailed information by clicking on the arrow dropdown next to the issue. There, you’ll also have an option to allowlist or blocklist.

And just like that, all of your lockouts are now taken care of.

Setting Up a Lockout Firewall Can’t Get Any Easier

Unwanted guests won’t get far with Defender’s custom IP address lockout.

And it’s more than just customized IP address lockout — there’s custom messages, location banning, logs, and much more with Defender.

To learn more tips on using Defender, check out our article about finding & deleting suspicious code and all about how to stop hackers in their tracks.

For more information, check out Defender’s documentation page.

How to Organize WordPress Files in Media Library Folders

Featured Imgs 13

Do you want to organize WordPress files in the media library folders?

By default, WordPress automatically creates folders in the media library based on year and months. However, some users may want to create their own custom folders for different media files.

In this article, we’ll show you how to easily organize WordPress files in custom media library folders.

Organizing your media library folders in WordPress

Why Organize Your Files in Media Library Folders?

Normally, WordPress stores all your images and other media files in the /wp-content/uploads/ folder. To keep it structured, all files are stored in folders organized by year and month.

https://example.com/wp-content/uploads/2020/07/

This works perfectly for most websites. However, some users may want to get better control on how WordPress stores media files.

For instance, a photography website may want to organize WordPress images by topic, location, or event folders. Similarly, a portfolio website may want to organize their media uploads by type, client, industry, and more.

This allows them to easily browse their media files. At the same time, it improves image SEO, as you can now add keywords in your image file URLs which makes URLs more meaningful.

Having said that, let’s take a look at how to easily create folders to organize your WordPress media files.

How to Organize Your WordPress Files in Media Library Folders

First, you need to install and activate the Media Library Folders plugin. For more details, see our step by step guide on how to install a WordPress plugin.

Note: The free version of the plugin only lets you create up to 10 folders. You will need to upgrade to the pro version if you want to make more.

Upon activation, the plugin will add a new menu item labeled ‘Media Library Folders’ in your WordPress admin sidebar. Clicking on it will open plugin’s folder view showing all the folders inside your WordPress upload directory.

The Media Library Folders page within your WordPress dashboard

From here, you can create new folders and add files to them. You can also move, copy, rename, or delete your files.

We’re going to create some new folders and add images to them.

To create a new folder, simply click the ‘Add Folder’ button and then type in the name you want to use for that folder.

Tip: You cannot use spaces in folder names. Instead, use hyphen or underscore to separate words if needed.

Adding a new folder using the Media Library Folders plugin

It’s also possible to make subfolders within folders, if needed. To create subfolders, simply click on the parent folder to select it, and then click on the ‘Add Folder’ button.

Adding a subfolder using Media Library Folders

We created two subfolders for our ‘Landscape-Photos’ folder. They are ‘Forests’ and ‘Mountains’. To view a subfolder, you need to click on the small arrow to the left of the main folder:

Click the small arrow to expand a folder to see the subfolders

To add files to your folders, simply click on the folder then click the ‘Add File’ button. After that, go ahead and upload as many files as you want.

Uploading files using the Media Library Folders plugin

Once you’re done uploading files, you’ll see them on the screen as thumbnails with the filename below:

The uploaded images showing in the Forests folder

It’s easy to add your uploaded files to your posts or pages. You can add them just like any other files that you’ve uploaded to the media library:

Viewing the uploaded images in the Windows Media Library

Moving and Copying Your Files in Media Library Folders

What if you need to move a file to a different WordPress media library folder? It’s easy to move it or copy it using Media Library Folders.

Moving an Image to a New Folder in the Media Library

To move an image or any other file, simply check that the move/copy toggle is set to ‘Move’ and then drag the image to the correct folder.

Tip: Your mouse pointer should be on the new folder, as shown below. The small thumbnail of the image is just showing you what you’re moving, not where you’re moving it to.

In this example, a mountain image was incorrectly placed in the Forests folder. We are moving it to the Mountains folder.

Moving an image into the Mountains folder

Copying an Image to a Different Folder in the Media Library

To copy an image, set the move/copy toggle to ‘Copy’, then go ahead and drag the image as before. Here, we are copying an image of a bird and flower, so that it’s in both the ‘Bird-Photos’ and the ‘Flower-Photos’ folders.

Copying a photo so that you have it in two folders

This time, your original image will stay in place. Your image will be duplicated so that it can be present in both folders.

Renaming Files and Folders in Media Library Folders

You can easily change the filename with the Media Library Folders plugin. First, find the file you want to change and click the checkbox below it. Next, click the ‘Rename’ button at the top of the screen.

After that, type in the filename you want to use. Image filenames can have a small impact on your WordPress SEO, so it’s recommended to use keywords within them. Here, we’ve changed the file name for a post on inspiring forest images:

Changing the file name of an image using the Media Library Folders plugin

You cannot rename or move a folder in Media Library Folders. However, it’s possible to create a new folder, move all the images into it, then delete the old folder.

To delete a folder, right click on it, and then click ‘Delete this folder?’ button. Here, we’ve moved the forest images into a new folder called Woodlands, and we’re deleting the Forests folder:

Deleting a folder using the Media Library Folders plugin

You’ll then see a message prompting you to confirm. Click ‘OK’ to continue and the folder will be deleted. You’ll no longer see it in the list:

The Forest folder has now been deleted

Tip: You may see the message ‘This folder is not empty and could not be deleted’ even though the folder looks empty. Simply click the ‘Sync’ button. WordPress may have created additional versions of your images that need deleting. After syncing, you’ll be able to review and delete those images.

Click the Sync button to check for other files in the folder

We hope this article helped you learn how to organize WordPress files in media library folders. You might also want to check out our articles on fixing common image issues in WordPress and other must have WordPress plugins for business websites.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Organize WordPress Files in Media Library Folders appeared first on WPBeginner.