On this page
WordPress powers nearly half the websites on the internet, and that very popularity makes it the first target of automated hacking tools that scan millions of sites every day looking for a single vulnerability. The reassuring news is that most of these attempts target known, fixable mistakes: a weak password, an outdated plugin, wrong permissions, or the absence of a firewall. This reference guide takes you step by step from the most important measures to the finest details, with comparison tables, ready-to-use commands, checklists and a complete response plan if your site actually gets hacked. Read it once in full, then use it as a work list to apply to your real site. If you are new to the platform, start first with the complete WordPress guide for beginners, then come back here to secure what you have built.
Why does WordPress get hacked in the first place?
Before we build the defense, we need to understand where the attack comes from. Contrary to popular belief, sites are rarely hacked through a vulnerability in the WordPress core itself — the core is one of the most audited and reviewed pieces of software. Real hacks come in from the surroundings: third-party plugins and themes, weak login credentials and misconfiguration. Understanding these sources lets you direct your effort where it matters instead of wasting time on theoretical risks.
The most common entry points
Most hacks are concentrated in a limited number of recurring weaknesses. Neglected plugins and themes (especially pirated "nulled" ones) top the list, followed by guessable passwords and the absence of two-factor authentication. The following table links each major threat to its mechanism and the countermeasure against it, and we'll go through each one in its own section:
| Threat | How it happens | Main countermeasure |
|---|---|---|
| An outdated plugin/theme with a vulnerability | Exploiting a published vulnerability before the update | Immediate update + removing unused ones + WAF |
| A pirated (nulled) theme or plugin | Downloading free copies injected with malware | Using official sources only |
| Password guessing (brute force) | Automated login attempts on wp-login.php | A strong password + 2FA + limiting attempts |
| A leaked/reused password | A leak from another service where you used the same password | Unique passwords + a password manager + 2FA |
| SQL injection or XSS | Malicious input through an unsanitized form or parameter | WAF + updates + a trusted plugin |
| Malicious file upload (web shell) | An upload vulnerability + lax file permissions | 644/755 permissions + blocking PHP execution in uploads |
| An unencrypted connection | Sending login credentials over HTTP | SSL/HTTPS + forced redirection |
| No backup | No clean copy after a hack | Automatic off-server backups |
What does a hacked site lose?
A hack doesn't just mean a broken page. The attacker may plant backdoors that stay active even after the password is changed, inject spam pages and hidden links that destroy your search rankings, redirect your visitors to fraudulent sites, steal your customers' data, or use your server to send spam so your domain ends up on blacklists. Google may also flag your site as a "Deceptive site," and your traffic collapses within hours. The cost isn't only technical but also reputation, trust and revenue — which is why we build layers.
One of the most dangerous features of WordPress hacks is that they are often silent. Contrary to the popular image of an attacker defacing the home page to announce victory, a professional attacker prefers to stay hidden for as long as possible. They inject their code into legitimate files, hide their admin accounts from the user list, and plant multiple backdoors so that one of them is enough to get back in if the others are closed. During this silent period, they may sell access to your server on the black market, or add it to a botnet rented out to launch attacks. So don't settle for monitoring the visible front end; monitor behavior: an unexplained rise in load, recently modified files you didn't touch, or messages bouncing from your email. All of these are early warning signs that deserve immediate investigation before the damage grows.
How do you make the login bulletproof?
The wp-login.php page is your site's front door, and it is the first target of automated guessing attacks. Securing this door alone stops a huge share of attempts. The rule is simple: make guessing practically impossible, and make stolen login credentials useless through a second layer.
A strong password and an unpredictable username
Never use the username admin — it is the first thing guessing tools try. Choose an unpredictable name, and a password of at least 16 characters mixing upper and lower case letters, numbers and symbols, which you don't reuse in any other service. Use a password manager (such as Bitwarden or 1Password) to generate and store it. The following table summarizes the recommended login settings:
| Setting | Recommended | Why |
|---|---|---|
| Username | Custom and unpredictable (not admin) | Denies the attacker half of the equation |
| Password length | 16 characters or more | Makes guessing impractical in terms of time |
| Password composition | Upper/lower case letters + numbers + symbols | Raises the password's complexity |
| Reuse | Strictly forbidden | Limits the impact of any external leak |
| Two-factor authentication (2FA) | Enabled for all administrators | Stops logins even with a stolen password |
| Limiting login attempts | 3–5 attempts, then a temporary block | Breaks guessing attacks |
| Changing the login URL | Optional (security through obscurity) | Reduces bot noise, nothing more |
Two-factor authentication (2FA): your most important layer
Two-factor authentication means that logging in requires something you know (the password) and something you have (a code from an app such as Google Authenticator or Authy). Even if your password is stolen outright, the account stays protected because the attacker doesn't have the changing code. Enable 2FA for every account with editing permissions, especially administrators. Codes from an authenticator app (TOTP) are safer than codes via text message (SMS), which are exposed to SIM hijacking.
The reason 2FA is the strongest single layer is that it breaks the most common chain in hacks: logging in with a stolen or guessed password. Most large leaks from other services' databases end up as lists of email addresses and passwords that are tried automatically on thousands of sites (an attack known as credential stuffing). So if you have reused your password somewhere that leaked, your site becomes exposed without you knowing — but 2FA stops the attacker at the threshold because they don't have your device. For extra robustness, store the backup recovery codes in a separate safe place when you enable 2FA; they are your lifeline if you lose or replace your phone. For sensitive sites, physical security keys (such as YubiKey, based on the FIDO2 standard) are the strongest option because they are phishing-resistant by nature.
Limiting login attempts and protecting wp-login
By default, WordPress allows an unlimited number of login attempts — which is exactly what guessing attacks exploit. Enable login attempt limiting (Limit Login Attempts) so an IP address is temporarily blocked after a few failed attempts. Add a CAPTCHA (reCAPTCHA) to the login form to stop bots. You can also protect the whole page at the server level with an extra password (HTTP authentication), so a visitor has to pass two barriers before even seeing the WordPress form.
Why are updates your first line of defense?
Updates aren't just for adding features — most of them patch discovered security vulnerabilities. When a security update is released for a popular plugin, the vulnerability details are published with it, and hacking tools immediately start scanning for sites that haven't updated yet. A delay of a few hours may be enough for a hack. So updating immediately isn't a luxury but a necessity.
Keep the core, plugins and themes updated continuously
WordPress supports automatic updates for the core and security fixes, and it is best to enable them. As for plugins and themes, review them at least weekly. And the golden rule: every plugin or theme you don't use = a risk that must be deleted, not just deactivated, because deactivated files remain exploitable. The following table shows the recommended update policy:
| Component | Update policy | Note |
|---|---|---|
| WordPress core | Automatic for minor security releases | Test major updates on a staging copy |
| Plugins | Manual weekly, or automatic for trusted ones | Read the changelog before updating |
| Themes | Manual, after taking a backup | Use a child theme to protect your changes |
| PHP version | The latest supported version | Old versions get no security fixes |
| Unused plugins | Delete completely, don't just deactivate | Deactivated files remain exploitable |
Beware of pirated (nulled) plugins and themes
Pirated free copies of premium plugins and themes are one of the most dangerous sources of hacks. They are often distributed injected with malware and hidden backdoors, opening your site to the attacker from the moment of installation. Never save money at the expense of security — download only from the official WordPress repository or directly from the developer's site. And keep an eye on the total number of plugins: the fewer there are, the smaller the attack surface. Choose a few trusted plugins instead of dozens of unnecessary ones, and see our guide to essential, trusted WordPress plugins to choose safe alternatives.
How does a WAF protect your site?
A web application firewall (WAF) stands between the visitor and your site, inspecting every request and blocking malicious ones before they reach WordPress. It is the layer that repels SQL injection and XSS attacks and mass exploitation attempts, and specifically new (zero-day) vulnerabilities before you are able to update the affected plugin, through what is known as virtual patching.
Cloud-level WAF vs. application-level WAF
There are two main types. A cloud firewall (a cloud WAF such as Cloudflare) works at the network level before traffic reaches your server, saving server resources and also repelling distributed denial-of-service (DDoS) attacks. An application-level firewall (such as the Wordfence plugin) works inside WordPress itself, understanding its context more precisely but consuming server resources. The best approach is often to combine them: cloud for early blocking, and application-level for precise inspection.
The WAF's greatest value shows specifically in the patching gap: those hours or days between the discovery of a vulnerability in a popular plugin and the moment you are able to update it. During this gap, the firewall can block the vulnerability's known attack pattern (virtual patching), protecting your site even if the affected plugin temporarily stays as it is. The firewall also repels the major categories of automated attacks: SQL injection that tries to leak your database, cross-site scripting (XSS) that injects scripts into your pages, and path traversal attempts to reach files outside the site's scope. And because a cloud firewall works at the edge, it also hides your server's real IP address, denying the attacker the ability to target it directly and bypass the protection. But note that the firewall is not a substitute for updating: it buys you time, nothing more, and the real fix remains updating or removing the affected component.
| Criterion | Cloud WAF (Cloudflare) | Application WAF (Wordfence) |
|---|---|---|
| Where inspection happens | Before the server (at the edge) | Inside WordPress |
| DDoS protection | Strong | Limited |
| Server resource usage | Negligible | Noticeable |
| Understanding the WordPress context | General | Deep and precise |
| Malicious file scanning | No | Yes (malware scan) |
| Best for | Every site, as a first layer | A precise complement to protection |
Is SSL/HTTPS necessary for security?
Yes, absolutely. An SSL certificate encrypts the connection between the visitor's browser and your server, preventing eavesdropping on login credentials, passwords and sensitive information in transit. Without HTTPS, everything is sent as plain text that can be intercepted on any intermediate network. Beyond security, HTTPS has become a ranking factor in search engines and a requirement for visitor trust.
Enable HTTPS and make sure to enforce it
Most hosting providers offer free SSL certificates via Let's Encrypt that can be enabled in a few clicks. After enabling it, it isn't enough for HTTPS to be available — you must enforce it by redirecting all HTTP requests to HTTPS, setting the site address in the settings to https://, and fixing "mixed content" (image or script links still on http://). See the full enabling and enforcement steps in the guide to installing SSL and enabling HTTPS. For extra strictness, enable the HSTS header to force browsers to always use HTTPS.
What are the correct permissions for WordPress files?
File permissions determine who can read, write and execute. Lax permissions (such as 777) are a security disaster because they let any process modify your files and inject malicious code. The general rule in WordPress: 644 for files and 755 for directories, with special tightening for wp-config.php.
The general rule: 644 for files and 755 for directories
755 for directories means the owner can read, write and execute, while others can only read and execute (no writing). 644 for files means the owner can read and write, while others can only read. As for wp-config.php, which contains the database credentials, it is tightened to 600 or 640 so it is completely unreadable to the public. The following table summarizes the correct permissions for each item:
| Item | Correct permission | Meaning |
|---|---|---|
| All directories | 755 | Owner: full · Others: read and execute |
| All files | 644 | Owner: read and write · Others: read |
wp-config.php | 600 or 640 | Completely unreadable to the public |
The wp-content/uploads directory | 755 | With PHP execution blocked inside it |
.htaccess | 644 (or 444 for tightening) | The server can read it, and it can't be modified easily |
| Any file/directory with 777 permissions | A serious mistake — fix it immediately | Allows everyone to write |
You can set the permissions all at once over SSH from the installation root with the following commands (apply them carefully and after taking a backup):
# 755 for all directories
find /path/to/wordpress -type d -exec chmod 755 {} \;
# 644 for all files
find /path/to/wordpress -type f -exec chmod 644 {} \;
# Tighten the sensitive configuration file
chmod 600 /path/to/wordpress/wp-config.phpHarden the wp-config.php file
The wp-config.php file is the heart of your site: it contains the database name and password and the encryption keys (salts). Protecting it is a top priority. Change the encryption keys using the official WordPress generator, block external access to it with a rule in .htaccess, and disable file editing from inside the dashboard so an attacker can't modify themes and plugins if they get in. Add the following lines:
# In .htaccess — block external access to the configuration file
<files wp-config.php>
order allow,deny
deny from all
</files>// In wp-config.php — disable the file editor in the dashboard
define( 'DISALLOW_FILE_EDIT', true );How do you set permissions and roles safely?
WordPress provides roles with graded permissions, and the security principle here is the principle of least privilege: give each user the lowest permission that is enough for their work, no more. Many administrators are a risk, since every administrator account is a potential way in. Review the user list regularly and delete inactive accounts.
The principle of least privilege
Don't make a content writer an administrator. An Author only needs permission to publish, and an Editor manages other people's content without touching the settings or plugins. Keep the Administrator role for as few trusted people as possible. The core idea is that every extra permission you grant an account is a permission the attacker automatically inherits if they compromise that account — a compromised administrator account means full control, while a compromised author account limits the damage to that author's content. That is why reducing the number of administrators isn't administrative housekeeping but a direct reduction of the potential damage area. The following table shows the roles and their permissions so you can choose the right one for each person:
| Role | Main permissions | Appropriate use |
|---|---|---|
| Administrator | Everything: settings, plugins, users, themes | The owner and as few trusted people as possible |
| Editor | Publishing and editing all content | The content manager |
| Author | Publishing and editing their own content only | Blog writers |
| Contributor | Writing drafts without publishing | External writers before review |
| Subscriber | Managing their own profile only | Registered members and commenters |
How do you protect wp-admin and the dashboard?
The dashboard (/wp-admin) is your site's control room, and restricting access to it greatly reduces the attack surface. After securing the login with 2FA, add a layer at the server level.
Restrict access by IP or with an extra password
If you manage the site from known static IP addresses, you can restrict access to /wp-admin to those addresses only via .htaccess. If your address changes, add an extra password layer at the server level instead (htpasswd), so two barriers are required before seeing the WordPress dashboard. An example of restricting access to a single address:
# In .htaccess inside the wp-admin directory — allow only a specific IP address
order deny,allow
deny from all
allow from 203.0.113.10Disable XML-RPC and hide version information
The xmlrpc.php interface is old and rarely used today, but it is exploited in amplified guessing attacks and DDoS attacks. If you don't need it (for example, for a mobile app or Jetpack), disable it completely. Also hide the WordPress version number and plugin versions from the page source, since they tell the attacker exactly which vulnerabilities to try. Most importantly: don't rely on "hiding" alone — security through obscurity is a helper layer, not a substitute for real hardening.
Why are backups the last safety net?
However many layers you build, the possibility of a hack remains — and the difference between a disaster and a passing incident is having a clean backup. A backup isn't a preventive measure but a recovery plan: it lets you restore the whole site within minutes instead of weeks of rebuilding. And the golden rule is that a backup is worthless unless its restore has actually been tested.
The 3-2-1 rule and off-server backups
The established rule in backups is 3-2-1: three copies of your data, on two different media, with at least one copy off-site. The fatal mistake is keeping the backup on the same server — if the server is hacked or its disk fails, the backup is lost along with the original. Store backups on a separate cloud service (such as Google Drive, Amazon S3 or Cloudflare R2). The following table shows the recommended backup layers:
| Layer | What it includes | Frequency | Storage location |
|---|---|---|---|
| Full backup | Files + database | Weekly | External cloud (off-site) |
| Database backup | Content and settings | Daily | External cloud |
| A backup before any update | The state before the change | With every major update | Local + cloud |
| Server snapshot | The entire system | Depends on the provider | The hosting infrastructure |
| Restore testing | Verifying the backup is sound | Monthly | A staging environment |
Automation and restore testing
Manual backups always get forgotten — so automate them with a trusted plugin (such as UpdraftPlus or your hosting's service) to run automatically, uploading directly to external storage. But more important than taking the backup is testing its restore regularly on a staging environment, because many sites discover in a disaster that their backups were corrupt or incomplete all along. A backup whose restore hasn't been tested = no backup.
Also pay attention to how long backups are kept (retention). Keeping only the latest backup is a common mistake, because a silent hack can go undetected for weeks — so your only backup is compromised too. Keep a series of backups going back several weeks, so you can always find a clean restore point from before the incident. And make sure the backups are actually running: enable success/failure notifications by email, because the biggest disaster is discovering when you need it that the scheduled task silently stopped months ago. Finally, remember that a full backup must include the files and the database together; a backup without the database loses all your content, and a backup without the files loses your themes, plugins and media.
Which security plugins do you need?
A single comprehensive security plugin saves you a lot: a firewall, malware scanning, login attempt limiting and 2FA in one package. But don't stack several security plugins together, since they may conflict and slow the site down — choose one comprehensive plugin and master its configuration. The following table reviews the main categories and common tools:
| Category | Common examples | What it provides |
|---|---|---|
| All-in-one security | Wordfence · Sucuri · iThemes Security | Firewall + scanning + 2FA + activity tracking |
| Cloud firewall | Cloudflare | Edge WAF + DDoS protection |
| Two-factor authentication | WP 2FA · Google Authenticator | A second login layer |
| Limiting login attempts | Limit Login Attempts Reloaded | Breaking guessing attacks |
| Backups | UpdraftPlus · BackWPup | Automatic external backups |
| Malware scanning | Wordfence Scan · MalCare | Detecting injected files |
Common mistakes in securing WordPress
Even well-intentioned people make mistakes that undo their security efforts. Avoid these recurring mistakes:
- Using the username
admin: half of the login equation is handed to the attacker. Change it immediately to an unpredictable name. - Postponing updates for fear of breakage: the solution isn't postponing but testing on a staging environment and then updating quickly. An unpatched site is a declared target.
- Keeping deactivated plugins: deactivation doesn't protect. The files stay on the server and remain exploitable — delete them.
- Storing the backup on the same server: when the server is hacked, the backup is lost along with the original. Always keep it external.
- Using pirated (nulled) plugins/themes: an illusory saving in exchange for a backdoor prepaid for the attacker.
- Giving everyone administrator rights: every administrator account is a way in. Apply the principle of least privilege.
- Relying on hiding alone: changing the login URL and hiding the version reduce noise, but they are no substitute for real hardening and 2FA.
- Neglecting file permissions (777): lax permissions open the door to code injection. Stick to 644/755.
What should you do if your site is hacked?
If you discover a hack — spam pages, strange redirects, a warning from Google, or unknown files — don't panic and don't delete everything at random. Follow a methodical response plan that preserves evidence and ensures the hack is removed at its roots, not just its symptoms.
Incident response, step by step
The order matters: don't restore an old backup before you understand how the attacker got in, or the hack will recur immediately. The most common mistake after a hack is jumping straight to restoring a backup and feeling reassured — while the original vulnerability stays open, so the attacker returns within hours through the same door. That is why a methodical response separates three distinct tasks: containing the current damage, then investigating the cause of entry, then recovering and closing the vulnerability. Follow the sequence below in exactly this order:
- Isolate the site: put it in maintenance mode or take it offline temporarily to prevent further damage and protect visitors.
- Change all passwords: WordPress, the database, hosting/cPanel and FTP — all of them, immediately.
- Take a copy of the current state: for evidence and analysis, even if it is compromised.
- Scan for malware: with Wordfence or Sucuri, and identify the injected files and backdoors.
- Clean or restore: it is usually best to restore a clean backup from before the hack, then update everything before putting it back online.
- Close the vulnerability: update/delete the plugin or theme responsible, and fix the misconfiguration — or the hack will come back.
- Review the users: delete any unknown administrator account the attacker created.
- Request a review: submit a review request to Google via Search Console to remove the "Deceptive site" warning.
Post-hack problems and fixes
After cleaning, you may run into lingering problems. The following table links common symptoms to their causes and fixes:
| Problem | Likely cause | Fix |
|---|---|---|
| The hack returns after cleaning | A backdoor that wasn't removed | Deep scan + restore a clean backup + update |
| A "Deceptive site" warning in Google | Leftover spam or redirects | Full cleanup, then a review request via Search Console |
| The site's email lands in spam | Sending abuse + blacklisting | Cleanup + delisting requests + SPF/DKIM |
| Spam pages in search results | Hidden content injection | Remove the injected files + reindexing |
| Sudden slowness or high load | The server used for mining/attacks | Cleanup + changing passwords + monitoring processes |
| You can't log in to the dashboard | The attacker changed your credentials | Recovery via the database/hosting |
The complete security checklist
Use this list as a regular review of your site. Go through it at least monthly:
| Item | Required status |
|---|---|
A username other than admin and a strong, unique password | ✓ Applied |
| Two-factor authentication (2FA) for all administrators | ✓ Enabled |
| Login attempt limiting + reCAPTCHA | ✓ Enabled |
| Core, plugins and themes up to date | ✓ Latest version |
| Unused plugins/themes deleted | ✓ Removed |
| A WAF firewall active | ✓ Enabled |
| SSL/HTTPS enabled and enforced | ✓ Enabled |
644/755 permissions and wp-config at 600 | ✓ Correct |
DISALLOW_FILE_EDIT enabled | ✓ Set |
| XML-RPC disabled (if not used) | ✓ Disabled |
| Automatic external backups + restore testing | ✓ Working |
| Regular review of users and roles | ✓ Done |
| A recent, supported PHP version | ✓ Up to date |
Expert tips for advanced security
Once the basics are in place, raise your level with these practices:
- A staging environment: test every update and change on a separate copy before applying it to the live site.
- Block PHP execution in the uploads directory: add a rule in
.htaccessinsidewp-content/uploadsthat blocks PHP files from executing, so even if a web shell is uploaded it won't run. - File integrity monitoring: a tool that alerts you as soon as any core file is modified, so you detect injection early.
- Limit attempts at the server level: Fail2ban blocks attacking addresses at the firewall level, not just at the application level.
- The defense-in-depth principle: don't trust a single layer. Assume each layer may fail, and let the next one catch the ball.
- The security of the hosting itself: your site is only as secure as its server. If you are on hosting with a cPanel control panel, apply the guide to securing cPanel as a foundation layer beneath WordPress.
Conclusion
Securing WordPress isn't a task done once but an ongoing process built on defense in depth: stacked layers, each of which buys time and raises the cost of a hack. Start with the highest return — a strong login, 2FA and a unique password — then regular updates that close the source of most hacks, then a WAF firewall that repels attacks before they arrive, SSL that encrypts every connection, correct file permissions (644/755) with wp-config.php hardened, and permissions based on the principle of least privilege. On top of all that, tested external backups are the safety net that turns a disaster into a passing incident. Apply the checklist above, review it monthly, and make security part of your site's maintenance routine rather than a reaction after it is too late.
Frequently asked questions
Is WordPress secure by nature? The WordPress core itself is secure and well audited, and most hacks don't come from it but from outdated or pirated plugins and themes, weak passwords and misconfiguration. In other words, your site's security depends more on how you manage it than on the platform itself. With the right layers, WordPress becomes very secure.
What is the single most important security measure to start with? Two-factor authentication (2FA) together with a strong, unique password, because it stops a huge share of hacks that start with stolen or guessed logins. Even if your password is stolen, the account stays protected by the changing code. Right after that, turn on regular updates.
Do I need a paid security plugin? Not necessarily at the start. The free versions of plugins such as Wordfence and Cloudflare's free firewall cover most basic needs. Paid versions add advanced features such as instant virtual patching and scheduled scanning, and they are worth the investment for business or high-traffic sites.
How often should I update WordPress? Enable automatic updates for core security fixes, and review plugins and themes at least weekly. When a security update is released for a popular plugin, update it as soon as possible, because hacking tools start scanning for unpatched sites as soon as the vulnerability details are published.
What are the correct permissions for WordPress files?
The general rule: 644 for files and 755 for directories, with wp-config.php tightened to 600 or 640. Avoid the 777 permission completely, because it allows everyone to write and opens the door to code injection. You can set them all at once with the find and chmod commands given in the dedicated section.
Is hiding the login URL enough protection?
No. Changing the wp-login.php URL reduces the noise from automated bots, but it is "security through obscurity" and doesn't protect against a targeted attack. Treat it as a helper layer on top of real hardening: a strong password, 2FA and limiting login attempts.
Is SSL alone enough to secure the site? No. SSL encrypts the connection in transit and prevents eavesdropping, but it doesn't protect against a weak password, a vulnerable plugin or a malicious file upload. It is a necessary layer within a complete system, not a comprehensive solution on its own. Combine it with the other layers.
How do I know if my site has been hacked? Signs include spam pages or links appearing, strange redirects for visitors, a "Deceptive site" warning from Google, unknown administrator accounts, sudden slowness or high load, and your email landing in spam. Scanning tools such as Wordfence and Sucuri detect injected files and suspicious changes automatically.
Where should I keep the backup? Always off the site's server, on a separate cloud service such as Google Drive, Amazon S3 or Cloudflare R2. Keeping the backup on the same server means losing it along with the original in a hack or a disk failure. Most importantly, test restoring it regularly to make sure it is sound.
Can updates break my site? Rarely, but the risk exists with major updates or manually modified themes. The solution isn't to postpone updating but to test it first on a staging environment and take a backup beforehand, then apply it to the live site. Postponing is far more dangerous than any possible breakage.
Sources
Frequently asked questions
Is WordPress secure by nature?
The WordPress core itself is secure and well audited, and most hacks don't come from it but from outdated or pirated plugins and themes, weak passwords and misconfiguration. In other words, your site's security depends more on how you manage it than on the platform itself. With the right layers, WordPress becomes very secure.
What is the single most important security measure to start with?
Two-factor authentication (2FA) together with a strong, unique password, because it stops a huge share of hacks that start with stolen or guessed logins. Even if your password is stolen, the account stays protected by the changing code. Right after that, turn on regular updates.
Do I need a paid security plugin?
Not necessarily at the start. The free versions of plugins such as Wordfence and Cloudflare's free firewall cover most basic needs. Paid versions add advanced features such as instant virtual patching and scheduled scanning, and they are worth the investment for business or high-traffic sites.
How often should I update WordPress?
Enable automatic updates for core security fixes, and review plugins and themes at least weekly. When a security update is released for a popular plugin, update it as soon as possible, because hacking tools start scanning for unpatched sites as soon as the vulnerability details are published.
What are the correct permissions for WordPress files?
The general rule: 644 for files and 755 for directories, with wp-config.php tightened to 600 or 640. Avoid the 777 permission completely, because it allows everyone to write and opens the door to code injection. You can set them all at once with the find and chmod commands given in the dedicated section.
Is hiding the login URL enough protection?
No. Changing the wp-login.php URL reduces the noise from automated bots, but it is "security through obscurity" and doesn't protect against a targeted attack. Treat it as a helper layer on top of real hardening: a strong password, 2FA and limiting login attempts.
Is SSL alone enough to secure the site?
No. SSL encrypts the connection in transit and prevents eavesdropping, but it doesn't protect against a weak password, a vulnerable plugin or a malicious file upload. It is a necessary layer within a complete system, not a comprehensive solution on its own. Combine it with the other layers.
How do I know if my site has been hacked?
Signs include spam pages or links appearing, strange redirects for visitors, a "Deceptive site" warning from Google, unknown administrator accounts, sudden slowness or high load, and your email landing in spam. Scanning tools such as Wordfence and Sucuri detect injected files and suspicious changes automatically.
Where should I keep the backup?
Always off the site's server, on a separate cloud service such as Google Drive, Amazon S3 or Cloudflare R2. Keeping the backup on the same server means losing it along with the original in a hack or a disk failure. Most importantly, test restoring it regularly to make sure it is sound.
Can updates break my site?
Rarely, but the risk exists with major updates or manually modified themes. The solution isn't to postpone updating but to test it first on a staging environment and take a backup beforehand, then apply it to the live site. Postponing is far more dangerous than any possible breakage.