WordPress is a very well-known open source website builder, worldwide up to 40% of websites using WP to buildThis has led many unscrupulous people to focus on WordPress to do some damage or hacking or other actions.
Every day there are countless programs that automatically scan websites built by WordPress worldwide, some are spamming, some are planting Trojan horses to do bad things, some are stealing quality articles and so on. Firewall plug-in must be installed, in addition to security can also intercept some unfriendly robot program greatly reduce the burden on the server as well as to protect the article content from theft.
In fact, the most powerful Wordpress security plugin is the paid version of Sucuri, which has a CDN level firewall. However, it does not have a GPL version, the original version is very expensive, and it will slow down the loading speed. iThemes Security and All In One WP Security are also good, but the features are not as powerful and comprehensive as Wordfence.
Wordfence is one of the best security plugins for the general public, with the best price/performance ratio, the most comprehensive features and the best protection. You can limit the number of login attempts, block malicious bot crawlers, block fixed IP/region access, block malicious traffic, enable 2FA login verification function, etc. Maximum security!
The image below is the notification email sent to the administrator after the SQL injection attack on the website was detected and successfully blocked by Wordfence.
Automatic blocking of malicious crawlers.
Web Application Firewall identifies and blocks malicious traffic. Built and maintained by a large team of 100% dedicated to WordPress security.
[Premium] Real-time updates of firewall rules and malware signatures via Threat Defense Feed (30-day delay for free version).
[Premium] Real-time IP blocking list blocks all requests from the most malicious IPs, protecting your site while reducing load.
Protect your site at the endpoint for deep integration with WordPress. Unlike cloud alternatives, it doesn't break encryption, can't be bypassed, and won't leak data.
Integrated malware scanners block requests that contain malicious code or content.
Prevent brute-force attacks by limiting login attempts.
WORDPRESS Security Scanner
Malware scanners check core files, themes and plugins for malware, bad URLs, backdoors, SEO spam, malicious redirects and code injection.
Real-time updates of malware signatures via Threat Defense Feed.
Compare your core files, themes and plugins with the content in the WordPress.org repository, check their integrity and report any changes to you.
Fix changed files by overwriting them with the original original version. Delete any files that do not belong in the Wordfence interface.
Checks your site for known security vulnerabilities and alerts you to any issues. Also alerts you to potential security issues when plugins are closed or abandoned.
Check your content security by scanning file content, posts and comments for dangerous URLs and suspicious content.
Check if your site or IP is blacklisted for malicious activity, spam generation or other security issues.
Two-factor authentication (2FA), one of the most secure forms of remote system authentication, is available through any TOTP-based authenticator application or service.
The login page CAPTCHA blocks the bot from logging in.
Disable or add 2FA to XML-RPC.
Block administrator logins using known compromised passwords.
Wordfence Central is a powerful and effective way to manage the security of multiple sites in one place.
Effectively assess the security status of all your websites in one view. View detailed security findings without leaving Wordfence Central.
Powerful templates make configuring Wordfence a breeze.
Highly configurable alerts can be delivered via email, SMS or Slack. Improve signal-to-noise ratio by utilizing severity level options and daily summary options.
Track and alert on critical security events, including administrator logins, password compromise usage, and spikes in attack activity.
Free for unlimited sites.
Use real-time traffic to monitor visits and hacking attempts not shown in other analytics packages in real time; including the source, their IP address, time of day and time spent on your site.
Block attackers by IP or build advanced rules based on IP ranges, hostnames, user agents, and referrers.
Wordfence Premium offers country/region blocking.
What is GPL plugin
WordfenceIt is a GPL licensed product and is safe and legal. Click to learn what isGPL AgreementClick to learnWordPress official website about GPL. Simply put using the GPL license plugin/theme source code open source sharing, can be legally free to change, use, distribution.
Directly from foreign formal channels to buy, do not modify the source code. All plug-ins we use to build their own sites, used in a number of sites, safe, stable and reliable.
- ByVirustotal Antivirus Verification;.
- ByWordfenceSource code review.
- BySucuriSecurity antivirus scan.
Wordfence update method/record
This plugin can be updated online in the background, and update directly by clicking Update when there is a new version.
Wordfence Download (Premium) Terms of Purchase
This site plug-in purchased from foreign sites, the purchase price is4.99 USD/pcIt is valid for 2 years. Diamo unified selling price of 19 yuan / piece, valid for life, and spend a lot of energy to create the use of tutorials also provide manual question and answer service, absolutely worth the money. The plug-in is only for learning and exchange research, virtual products are reproducible, once sold no refund, please move to the detailsTerms of Service.
Diamo for the purchase of users to provide after-sales service, plug-in use any questions please leave a message in the comments below, there will be answers to questions.
How to install/enable Wordfence
Install the downloaded installation package directly to enable the plugin.
Installation method 1: Upload and install
Find and click on "Plugins" > "Install Plugins" in the left menu bar of the website background, then click on "Upload Plugin" in the upper left corner, upload the downloaded zip installation package and click on "Install Now", after installation, click"Enable Plugin"Complete the installation.
Installation method 2.FTP installation
Unzip the plug-in package, put the unzippedFoldersUpload it to the plugins directory (xxx.com/wp-content/plugins).
Find and click on "Plugins" > "Installed Plugins" in the left menu bar of the website background, find the plugin in the list of plugins, and click "Enable".
Wordfence enables, configures firewall
After installing the plug-in, a prompt will appear at the top of the site as shown below, and the firewall will need to be configured before it can be enabled. Click the "Click here to configure" button.
Installation method 1
The number 1 there will automatically select the appropriate type according to the server situation, do not care. Click the number 2 in order, 3 steps to operate.
In general, the installation will be prompted successfully, and the firewall will be enabled some time after clearing the cache and refreshing. If the installation fails to prompt the following content, it is because the .user.ini file permissions are locked, resulting in the content not being written.
There are 2 ways to solve this problem, 1 is to manually edit the .user.ini file to add a line of content, 2 is to use SSH login to lift the .user.ini file write restrictions and then return to the site backend according to Wordfence plug-in prompts and then enable the firewall can be.
Manually edit the .user.ini.
Go to the root of the site through the admin panel or FTP, find and open the edit.user.ini file. By default there is only one line of content as shown in the figure below.
Copy the following 3 lines of code, change xxx.com to the URL in the yellow box above, then paste the 3 lines of code into .user.ini, and click Save to modify.
; Wordfence WAF auto_prepend_file = '/www/wwwroot/xxx.com/wordfence-waf.php' ; END Wordfence WAF
The image below shows what it looks like after pasting 3 lines of code ↓.
Go back to the website backend and refresh the page, at this time the firewall protection has been enabled.
SSH unrestricted .user.ini writes.
To log in using SSH, type the following directly and press enter to unrestrict.
Change xxx.com to your site's domain name.
chattr -i /www/wwwroot/xxx.com/.user.ini
This is what it looks like after pasting
This is what it looks like after pressing the Enter key
Finally go to the pagoda panel, go to the site root folder and find the .user.ini file Click on "Permissions". . Check all permissions and click "OK".
At this point and then re-enable the firewall according to the above tutorial will prompt a successful installation ↓.
Refresh the site cache and refresh the page again after the firewall has been 100% enabled.
Note: Be sure to go back to the pagoda panel and change the .user.ini file permissions back to 644 as shown below.
Installation method 2
Note: This method is mainly suitable for shared (hosting) servers or VPS servers with only one website. If the VPS server hosts more than one website, you need to turn off the "anti-cross-site attack" on the other websites (which will reduce the security of the website), otherwise the other websites cannot be opened. It is recommended to use method 1 to install.
If it is a shared (hosted) server, it should be activated automatically after following the above diagram. If it is a VPS Nginx will prompt to install auto_prepend_file = '/www/wwwroot/xxx.com/wordfence-waf.php'
Take the pagoda panel for example, inside the PHP management > "configuration file", about 698 lines to find"auto_prepend_file ="This content, supplemented with the code of the interface prompt later'/www/wwwroot/xxx.com/wordfence-waf.php' (This code is just an example don't copy and paste directly!) Then refresh the pagoda panel memory, go back to the site background to refresh the page cache, advanced firewall has been enabled (showing 100%).
Enable 2FA secure login authentication
2FA is a double-factor authentication, which requires a verification code when logging in (no need to go over the wall) and functions similar to a bank U shield or an electronic password. It is recommended to turn on 2FA secure login verification to greatly improve security.
Click on "Login Security" in Wordfence on the left side of the backend, and then click on "Settings" at the top. Here you can set what role you want to enable 2FA secure login authentication, and choose whether you want to make login authentication mandatory or free (Optional). Generally, only your company's back office administrator and so on will enable secure login, customers and so on are not recommended to open.
Click on the check box below and tap "SAVE" to save. This will require verification the first time you log in to your new device, and no verification for the next 30 days.
Click on " at the topTwo-Factor Authentication"Enter the binding authenticator interface. Phone first go to Google Paly or Apple Store to download Google Authenticator software (below), if you can't open the Google Store click this linkDownload Android APK installer.
Back to Wordfence's "Two-Factor Authentication"interface (below). Open the just-installed Google Authenticator software, click on the bottom right corner of the software that colorful circle + sign, select "Scan QR code", scan the Wordfence interface in the QR code to complete the site binding. At this point Google Authenticator will display a line of information: Wordfence (xxx.com), (you may need to click "Click to reveal PIN") will display a 6-digit verification code, enter the red box in the following chart "ACTIVE " in the red box below.
You will be prompted to download the recovery key, click on it to complete the binding. The recovery key can be used as a backup solution to log in to the website without the verification code, so keep it safe.
The next time you log in, you will be prompted to enter 2FA Code, open the cell phone authenticator software, enter the 6 digits inside the software and click "Log In" to log in. Check the "Remember for 30 days" box and you won't need to enter the verification code when you log in to the same device within 30 days.
Wordfence setup and use tutorial
Click to viewWordfence setup tutorial.
Common Problems & Solutions
1) If the scanning process automatically pauses and prompts the following content, it is generally because the server is busy scanning timeout.
1- Change the max_execution_time to 1000 or more in the pagoda panel under PHP Settings > Configuration changes.
2- Add the following code to wp-config.php in the root of the website and save the file.
3- In Wordfence Plugin > "Scan" > "Scan Options and Schedules" (middle position on the right).Scan level select "high sensitivity"Find the "Performance Options" setting and change the maximum execution time to 25. Find the "Performance Options" setting and change the maximum execution time to 25. Check the "Use low resource scanning" box if the server configuration is very low, otherwise don't check it.
After operating the above 3 steps refresh the page point rescan should return to normal.
If the scan process automatically pauses and prompts the following content, it is caused by the small size of innodb_log_file_size (default is 5M).
Go to pagoda panel > "MySQL" > "Configure Changes" > about 51 lines, change the value of innodb_log_file_size to 30M. Save and restart the database. Refresh the page and rescan to restore normal.
2) If you encounter that you cannot save articles, products or some plug-in settings, etc., it may be blocked by the security plug-in, turn on the learning mode to solve the problem. Click Wordfence > "Firewall". The red box below indicates "blocking complex attacks", which proves that it is not in learning mode.
Select Learning Mode, check Auto Enable, and select an auto enable date. Tap "Save Changes" in the upper right corner.
Go back to the firewall and show "currently in learning mode"
3）After scanning, you may find many problems marked in yellow (below), indicating that the code of some files of the plug-in is different from the source file, but it is within the safety range, in most cases you can directly click "Always ignore", it is recommended to check the code differences and operate according to the situation.
This is usually caused by updating the plugin/theme and the code of the latest version is a bit different from the code of the previous version. Another reason is that the GPL or cracked version of the plugin is used, and the source file is written to the license key to activate or some code is added to block the verification step or something.
Click on "View the differences"You can view the codes with differences.
For example, the figure below shows a comparison of the file differences, the left is the source file, the right is the new file, the red background part means that the new file has less code than the source file. From the figure below, you can see that the new file has a few lines less CSS code (9-23 lines). css code does not affect security and so on, you can click "Always ignore".
The orange background below indicates that the new GPL plugin file is partially different from the source code, the new file adds "PAID CURRENT" to bypass the plugin activation verification, the file is safe and can be accessed by clicking "Always ignore".
The green background part below indicates the code added to the new file than the source file, the code means the secret key key expires after 365 days, also to bypass the plugin activation verification, the file is safe to click "Always ignore".
If the problem is prompted by a red circle, there is a high probability that it is hung and the file needs to be deleted/restored. The situation depends on which file has the problem and what code has been added. If it's a file like readme, delete it directly, if it's a file like index.php, login.php, etc., download a brand new wordpress installation package and extract it, paste the corresponding file inside to overwrite the file that was hung, and clean up all the cache.
(4) If this happens, it is blocked by the firewall by mistake. Check the box "I am certain this is a false positive", then click "Allowlist This Action", and finally refresh the page to restore normal.
Share the case of a previous customer's website being hung with Malicious Redirects, just for your reference.
A 2C customer's website was hung, the backend login page and all the frontend pages automatically jumped to the website below, and it was impossible to log into the backend. Two other websites on the same server were also involved.
The backend login is controlled by the wp-login.php file, the login is not up the first time to the root of the site to check the source code of this file, found that more than ten lines of malicious code was added. I copied wp-login.php from the health site and overwritten it, and the login page returned to normal.
The home page is controlled by the wp-index.php file, go to the root of the site to check the source code of this file and found that it is also hung, copy the wp-index.php file from the health site to overwrite it, the page opens normally and no longer skips.
Scanning the entire site using the WordFence plugin resulted in.
Prompted wp-load.php with a virus, compared with the source file of the health site found that 107 lines were added to the malicious code, delete all the added code.
Tip wp-content/plugins/wordfence/readme.md virus, check the latest plug-in installation package source file found that there is no such file, and the readme file is generally descriptive file does not have the function can be deleted, so directly delete this file.
After dealing with the threat and then scanning the whole site with WordFence, it suggests that the files cached by Wp Rocket have viruses, which should be cached when the cache is regularly updated with toxic files. Go directly to the Pagoda panel to delete the entire cache folder and let the cache plugin re-cache it.
Scan the whole site again with WordFence, prompting security and threat removal. Immediately change the backend login address, login username and password.
Review of this incident should be one of the customer's website login and password is too simple to be cracked, the customer initially find someone else to build a good backend to engage in their own website unsuccessful to find us to deal with, others casually set him a 4-digit administrator login name, did not install the firewall plug-in ....
Many scanners on the Internet automatically scan websites for vulnerabilities, enumerate login backgrounds and the like, and then hang mining programs or Trojan horses to jump to gambling/virus sites. Background login address must be modified not to use the default address, user name and password as complex as possible to set. It is recommended to install security plug-ins such as WordFence can greatly enhance the security of the site, but also to increase the 2FA security login verification.
WordPress many plug-ins are often exposed to major security vulnerabilities, even the well-known Elementor plug-in has been several times exposed to serious security vulnerabilities, the official emergency release of a new version to fix. Try to install a relatively high visibility plug-ins / themes, code is generally more standardized, the team behind the strength of reliable. Plugins, themes must be updated to the latest version in a timely manner.