A 2023 guide to WordPress security
WordPress is the most popular content management system in the world. About 40% of all websites on the internet and almost 60% of CMS-based websites are built on WordPress, which makes it one of the most attractive targets for hackers. One of the reasons WordPress is attacked so often is that it relies on a large number of open-source plugins. These plugins may contain malicious code and scripts that give hackers a way to inject malware into WordPress and commit criminal acts. In addition, hackers also use new WordPress Google Dorks to find vulnerable websites and confidential information.
Some common reasons why WordPress sites get hacked:
- Vulnerabilities in third-party plugins and themes: many plugins and themes contain vulnerabilities that hackers can use to hack a website.
- Weak passwords: weak administrator account passwords can be cracked easily, giving hackers full access to the website.
- Outdated WordPress versions: WordPress versions that have not been updated may contain vulnerabilities that hackers can use to hack a website.
- Unauthorized access to files and folders: if files and folders on the server are not configured correctly, hackers can gain access to them and make changes to the website.
- SQL injections: SQL injection attacks can allow hackers to access the website database and change its contents.
- Password brute-forcing: hackers can use password brute-force programs to guess the administrator password and gain access to the website.
- Malicious code infection: hackers can inject malicious code into a website, which can be used to steal user data or spread malware.

Any website on the internet can be the target of hacking attempts, not only WordPress sites. However, WordPress is the most popular content management system in the world, which makes it a frequent target for hackers. Proof of this is the high search volume for the phrase “how to hack a WordPress site 2023”.
What leads to WordPress hacks
Reason 1. Vulnerable plugins and themes
One of the most common reasons WordPress sites get hacked is the use of vulnerable plugins and themes. Some plugin and theme developers do not update their products, which leaves them vulnerable to attacks. To avoid this, it is recommended to use only reliable plugins and themes that are updated regularly. You should also remove all unused plugins and themes to reduce the likelihood of vulnerabilities.
Reason 2. Weak passwords and insufficient protection of the administrator account
Weak passwords and insufficient protection of the administrator account are another common reason WordPress sites get hacked. Hackers can use dictionary attacks or password brute-forcing to access the administrator account and take full control of the website. To avoid this, you should use strong passwords and two-factor authentication and avoid the username “admin”.
Reason 3. An outdated version of WordPress
Some WordPress site owners do not update their websites to the latest versions, which leaves them exposed to known vulnerabilities. To avoid this, you should regularly update your website to the latest version of WordPress.
Reason 4. Insufficient protection of wp-config.php
The wp-config.php file contains confidential information about your WordPress site, including database information and encryption keys. If this file is compromised, hackers can gain access to your database. To avoid this, make sure that the wp-config.php file is stored in a safe location and cannot be accessed from outside.
Of course, this is not a complete list of every possible reason a WordPress site can be hacked, but by following these recommendations, you can significantly improve your website security.
Different ways to hack a WordPress site
Hackers use different methods to gain access to WordPress sites depending on their goals. Below are the most common attacks and methods used against websites built on WordPress:
- Creating new users via FTP
If HTTP is not available to hackers, they will try to access the FTP server and create new administrator accounts. All they need for this is FTP access to your website. As an administrator, a hacker will get all the information needed to connect to the server and create new user accounts by adding a new function through your theme. - Modifying the functions.php file
There are two ways to modify the functions.php file: the first is through cPanel, the second is with an FTP client. Using cPanel, hackers open the file manager and find the active theme folder. Then they go to the public_html/wp-content/themes folder and find the theme. All that is left is to open its functions.php file and add code before the closing tag. Do not forget to change the password. After creating a new account, hackers remove the code from the functions.php file. - Using cPanel/MySQL
This method is used to change the password of an existing user or to create a new account. To do this, you will need access to cPanel or to the website database through MySQL. If you use cPanel, log in, find and open phpMyAdmin. Find the table that ends in _users (most likely it will be wp_users) and edit the user_pass field, replacing the password hash with one generated using the MD5 algorithm. Then save the changes and log in to WordPress with the new password.
There are several techniques and exploits that can be used to hack WordPress. Some of them include:
- Password brute-force attacks: Hackers can use password brute-forcing software to automatically try to log in using different combinations of username and password. To defend against such attacks, it is important to use strong passwords and install plugins that can stop brute-forcing.
- Attacks on vulnerable plugins and themes: Hackers can look for vulnerabilities in WordPress plugins and themes and use them to hack a website. To avoid such attacks, it is important to update plugins and themes regularly, remove outdated plugins and themes that are no longer used and choose only popular and trusted plugins and themes.
- Database attacks: Hackers can use vulnerabilities in WordPress to gain access to the website database. To defend against such attacks, it is important to use strong database passwords, back up the database regularly and encrypt the data stored in the database.
- XSS attacks: Hackers can use XSS attacks to inject malicious JavaScript code into the pages of a WordPress site. To avoid such attacks, it is important to use firewalls and filters that can block malicious JavaScript code.
- Man-in-the-middle attacks: Hackers can use man-in-the-middle attacks to intercept data transmitted between the user and the WordPress server. To avoid such attacks, it is important to use a secure connection such as HTTPS and encrypt the data transmitted between the user and the server.
Overall, to keep your WordPress site from being hacked, it is important to use strong passwords, install only popular and trusted plugins and themes, update plugins and themes regularly and back up the database.
XSS attacks in WordPress

XSS (cross-site scripting) is a common vulnerability in WordPress and can be used to gain access to users’ cookies, which allows attackers to impersonate them.
To defend against XSS attacks, it is recommended to use special plugins that filter malicious scripts and code out of user input. You should also use firewalls that can block requests containing suspicious characters and requests that look like XSS attacks.
HTTPS connections do not protect against XSS attacks, but they prevent traffic eavesdropping and tampering with the data in transit. Finally, regularly updating WordPress and all plugins and themes installed on the website is an important step in preventing vulnerabilities, including XSS.
Malware

Malware is a serious threat to computer systems and devices. It can also lead to data loss, financial losses, leaks of confidential information and even identity theft. To defend against malware, it is recommended to use antivirus software and update it regularly, not open suspicious emails and attachments, not download software from untrusted sources and not visit suspicious websites. It is also important to regularly update the operating system and software to fix vulnerabilities that hackers can use to infect the system.
A few tips that can help improve your website security:
- Use two-factor authentication to log in to your account. This will significantly reduce the risk of your account being hacked, even if your password leaks.
- Limit the number of login attempts to your account. This can help prevent brute-force attacks on your password.
- Hide the WordPress version you use. This can help prevent attacks based on known vulnerabilities in a specific version of WordPress.
- Use secure hosting. Hosting that provides good protection against DDoS attacks and other malicious attacks can help significantly improve your website security.
- Install an SSL certificate on your website. This will protect the data transmitted between your website and users from interception.
- Check your website for malware periodically. You can do this with special online services such as VirusTotal.
I hope these tips help you improve the security of your WordPress site!
Frequently asked questions
Website cleanup
A website cleanup service may include the following steps:
- Hack detection: experts analyze your website to identify vulnerabilities and the methods used to hack it. This makes it possible to find the attackers’ entry points and make sure that all vulnerabilities have been fixed.
- Stopping the threat: specialists block the attackers’ access to your website and hosting account to stop the attack from going further.
- Malware removal: experts find and remove any malware that may be on your website. This includes removing viruses, trojans, spyware and other malicious elements.
- Data recovery: if your website was damaged or changed by attackers, the cleanup service can restore the data and return the website to its normal state.
- Security measures: experts can suggest additional security measures for your website to protect it from future threats and attacks.
RIVERIT specializes in cleaning up hacked WordPress sites, and our services can include all of the steps above, as well as advice on your website security.
Quick and effective intervention
The RIVERIT team provides cleanup and protection services for WordPress sites. The service includes quick and effective intervention to regain control of the website and return it to perfect working order. Cleanup includes removing malware, files and code that can harm your website. Protection includes installing and configuring additional security measures to prevent a repeat attack.
Priority support
Six steps we take for your website security:
- We will run a full scan of your website, starting with WordPress, to identify the problem and fix it at the root.
- We will clean up your website, removing malicious files and notifying Google that your website meets its requirements.
- We will install and configure highly effective security tools to prevent new attacks and minimize the risk of the problem happening again.
- We will give you recommendations on your website security to prevent hacks in the future.
- We will restore your website so that it is protected and 100% functional online.
- We will offer support and maintenance services that include updates, backups and security scans so that your website keeps running and stays safe.
Our security hardening procedures improve the security of your WordPress site. You can contact a specialist with any questions about your website security at any point throughout the process.













