Home » Blogging » Improve WordPress Security with 9 Advanced Tips
How to Improve WordPress Security in 9 Steps

This page may contain affiliate links or sponsored content. Please read my disclosure page.

WordPress is a constant hacking target, so let’s learn in this article how to improve WordPress security in 9 steps and discover the best WordPress security plugins.

Some practices require a bit of technical know-how, but even beginners can benefit. And if coding isn’t your thing, don’t worry! There are plenty of plugins to handle the heavy lifting for you.

With a bit of patience, you can dramatically increase the security of your WordPress website and keep your hard work safe from hackers.


Related: 5 Reliable Ways To Protect Your Privacy As a Blogger


Important Note:
Before making any security changes to your WordPress site, always perform a full backup using a plugin like Solid Backups. This ensures you can restore your website quickly if something goes wrong during updates, plugin changes, or configuration adjustments. 
A complete backup should include your website files, database, and media uploads. If your hosting provider offers automated backups (like DreamPress does), double-check that the latest backup has been created before you begin.


WordPress Security Checklist: How to Improve WordPress Security

Woman's hands type in a notebook, she's learning how to improve WordPress security in 9 steps using a WordPress security checklists, searching for the best WordPress security plugins, and hardening WordPress.
Image: Unsplash

1. Choose (Or Migrate to) a Managed Web Hosting

Your hosting provider has a massive impact on your website’s security. Even if you follow every best practice, your site can still be vulnerable if the server isn’t protecting you. That’s where DreamHost’s managed WordPress hosting, DreamPress, makes a big difference.


DreamPress strengthens your WordPress security by offering:

  • Automatic WordPress updates — prevents vulnerabilities caused by outdated versions.
  • Daily backups — ensures you can quickly restore your site if anything goes wrong.
  • Built-in server-level firewall — blocks malicious traffic before it ever reaches WordPress.
  • Real-time monitoring — detects suspicious activity and potential threats 24/7.
  • Free SSL certificate — encrypts all data between your site and users.
  • Isolated resources — prevents other websites on the server from affecting yours.
  • Expert WordPress support — ideal if you’re not technical or don’t want to manage security yourself.


Most WordPress breaches happen due to outdated software, weak hosting security, or misconfigured servers. DreamPress automatically addresses many of these issues, giving your site a safer, more reliable foundation.


2. Replace the Default WP-Admin User to Improve WordPress Security

When WordPress is pre-installed by your hosting service, it often creates a default Admin account. This account usually uses your blog name as the username, which hackers can easily guess, especially if your password is weak.

To protect your site, create a new user account with Administrator privileges and delete the default one.


Steps to create a new Admin account:

  1. Log in to your WordPress Dashboard as the current Admin.
  2. Go to Users > Add New.
  3. Fill in the details (use a different email) and set the Role to Administrator. Save.
  4. Log out and log in with the new Admin account.
  5. Navigate to Users > All Users, hover over the old Admin, and select Delete.
  6. Reassign all posts from the old Admin to the new account to avoid losing content.


Pro tip: Use a long, complex username – avoid your real name or pen name. Combine words, symbols, or random letters to make it hard to guess.


3. Hide Author Usernames by Changing the Author Slug / user_nicename

By default, WordPress exposes your login username through the author slug in URLs. For example:


websitename.com/author/authorusername


In other words, user_nicename is just the author slug, which is, by default, the Author login username. Also, the user_nicename has no use for logging into a website if this is not the same as the Author’s login username.

If your login username is visible here, hackers can target it in brute-force attacks.

To improve WordPress security, hide your real username by changing the user_nicename in your WordPress database via phpMyAdmin.


WordPress Security Checklist: Steps to change user_nicename:

  1. Log in to your web hosting Control Panel (cPanel).
  2. Go to MySQL Databases or Databases and select Manage Database.
  3. Open phpMyAdmin and select your website’s database (e.g., yourwebsite_com).
  4. Find the table wp_xxxxx_users and locate the user_nicename column.
  5. Double-click the user_nicename you want to change, type the new value, and confirm.
  6. Check your website by clicking an author’s name on a post to ensure the new slug works.


IMPORTANT: Only change the user_nicename! Don’t modify any other database settings.


4. Add the Recommended HTTP Security Headers for Advanced WordPress Security

HTTP (HyperText Transfer Protocol) Security Headers are essential for protecting your WordPress website (and great for your Core Web Vitals). They help secure the connection between your site and its visitors, preventing hackers from redirecting users to fake sites, injecting malicious code, or exploiting browser weaknesses.

While there are many HTTP Security Headers available, you don’t need to implement all of them. Some are outdated, and others are complex enough that a single mistake could bring your website down.

However, there are four headers you should add immediately to improve WordPress security significantly:


1. X-Frame-Options
Prevents clickjacking by stopping your site from being embedded in another website via an iframe, which could otherwise trick users into performing unintended actions.

2. HSTS (Strict-Transport-Security)
Protects your site from redirects to insecure or fake domains. It ensures browsers always connect via HTTPS, blocking attackers who try to send visitors to a malicious, non-secure site.

3. X-Content-Type-Options
Stops browsers from guessing the type of files being downloaded (like PDFs). This prevents hackers from tricking your visitors into downloading malicious files instead of legitimate ones, keeping both users and your site safe.

4. X-XSS-Protection
Guards against cross-site scripting (XSS) attacks that can steal cookies or sensitive data from your visitors. When an XSS attack is detected, this header blocks the page from loading.


How to Add HTTP Security Headers to Increase the Security of a WordPress Website

Steps:

  1. Log in to your hosting cPanel.
  2. Navigate to Websites > FTP Users & Files (the name may vary by host).
  3. Select Manage Files and open .htaccess under your website folder (e.g., yourwebsite.com).
  4. Scroll to the bottom, skip a line, and add the following code:
# Security Headers
<IfModule mod_headers.c>
    Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" env=HTTPS
    Header always set Content-Security-Policy "upgrade-insecure-requests"
    Header always set X-Content-Type-Options "nosniff"
    Header always set X-XSS-Protection "1; mode=block"
    Header always append X-Frame-Options SAMEORIGIN
</IfModule>
# End Security Headers
  1. Save the file and close the editor.


Adding these headers is a powerful step to improve the security of your WordPress site, protecting both your content and your visitors from common web attacks.


5. Disable Directory Listing / Directory Browsing to Improve WordPress Security

Directory Listing (or Directory Browsing) exposes an index of all files in a folder on your website. Hackers can use this to locate sensitive files and exploit vulnerabilities. You can test this by visiting:

yourwebsite.com/wp-includes/css

If you see a list of files, your site is vulnerable – scary, right?

To improve the security of your WordPress site, you should disable directory browsing.


How to Disable Directory Browsing Manually to Improve WordPress Security

Steps:

  1. Log in to your hosting cPanel.
  2. Go to Websites > FTP Users & Files and open Manage Files.
  3. Open the .htaccess file under your website folder (e.g., yourwebsite.com).
  4. Scroll to the bottom, skip a line, and add:
Options -Indexes

Save the file. Check by visiting yourwebsite.com/wp-includes/css. If done correctly, your browser should display your site’s default 404 Not Found Page instead of a file list.


How to Disable Directory Browsing Using Solid Security / SolidWP

If coding isn’t your thing, the Solid Security plugin (formerly iThemes Security) makes this easy and safe:

  1. Log in to your WordPress Dashboard as Admin.
  2. Go to Security > Advanced (bottom left).
  3. Under System Tweaks, check Protect System Files and Directory Browsing.
  4. Save – done!


6. Disable File Editing to Improve WordPress Security

By default, WordPress allows Administrators to edit plugin and theme files directly from the Dashboard. While convenient, this poses a serious security risk:

  • Accidental changes by an Admin could break your site.
  • If a hacker gains access to an Admin account, they could manipulate your code and steal sensitive data.

The simplest and safest way to prevent this is to disable file editing using the Solid Security plugin. You can temporarily re-enable it if necessary, but it’s best to keep it off.


How to Disable File Editing via Solid Security / SolidWP

  1. Log in to your WordPress Dashboard as Admin.
  2. Navigate to Security > Advanced (bottom left).
  3. Under System Tweaks > WordPress Tweaks, select Configure Settings.
  4. Check the Disable File Editor checkbox.
  5. Save changes.

With file editing disabled, your site is significantly more secure against accidental or malicious code changes.


7. Prevent PHP Direct Execution in Sensitive Directories

Hackers often target sensitive WordPress directories like wp-content, wp-includes, or even the .htaccess file in your root folder. If they gain access, they can upload malicious code and execute it remotely – potentially taking down your entire site.

To improve the security of your WordPress site, one of the most effective strategies is to disable PHP execution in these vulnerable directories.


How to prevent PHP direct execution via Solid Security:

  1. Install the Solid Security (SolidWP) plugin if you haven’t already.
  2. Log in to WordPress as an Administrator.
  3. From your Dashboard, select Security → Advanced.
  4. Under System Tweaks, enable all the PHP Execution options:
    • Disable PHP in Uploads
    • Disable PHP in Plugins
    • Disable PHP in Themes
  5. Save your settings.


This single step can drastically increase the security of your WordPress website and block a common attack vector.


8. Limit Password Guessing Attempts

Password guessing, or brute force attacks, is one of the most common ways hackers try to break into WordPress websites. Automated bots attempt millions of password combinations until they get it right – unless you stop them.

A simple way to improve WordPress website security is to limit the number of login attempts. This ensures hackers and bots can’t endlessly test passwords until they succeed.


How to limit login attempts with Solid Security:

  1. Install the Solid Security plugin if you don’t have it yet.
  2. Log in as an Administrator.
  3. From the Dashboard, select Security → Configure → Lockouts.
  4. Under Local Brute Force, set:
    • Max Login Attempts Per Host
    • Max Login Attempts Per User
  5. Choose a time limit under Minutes to Remember Bad Login.
  6. Save your settings.


⚠️ Tip: Don’t set the maximum login attempts too low – you don’t want to lock yourself out if you mistype your password once or twice.


9. Moderate Comments for Advanced WordPress Security

One often-overlooked way to improve WordPress security is through careful comment moderation. By default, you should never allow comments on your blog posts to be automatically approved. As your site traffic grows, spam activity in the comments section will inevitably increase.

These spam comments usually contain malicious links that put both your site and your visitors at risk. A single careless click could expose your readers to harmful websites, damaging both your reputation and your WordPress website security.


How to set comments to moderation mode in WordPress:

How to manually approve comments in a WordPress site via your Admin dashboard to improve WordPress security.
WordPress dashboard accessed via an Admin account.
  1. Log in as an Administrator.
  2. Go to Settings → Discussion in your WordPress dashboard.
  3. Scroll down and check:
    • Comments must be manually approved
    • Comment author must have a previously approved comment
  4. Adjust additional preferences as needed, such as whether to allow link notifications (pingbacks/trackbacks) or which email alerts you’d like to receive.
  5. Save your changes.


Tips for safe comment moderation to improve WordPress security:

  • Use a spam-blocking plugin. A tool like Hide My WP can automatically filter spam, save you time, and add extra protection. It not only reduces spam but also hides your WordPress site from theme detectors and attackers.
  • 🚩 Watch out for generic praise. Comments like “This is the best article I’ve read in this field, great job!” may look flattering but are often spam. If the feedback is vague and not specific to your content, treat it as suspicious.

By moderating comments, you not only protect your readers but also increase the security of your WordPress website without adding much technical complexity.




How to Check If Your WordPress Site Is Secure

Regularly scanning your WordPress site is essential to catch vulnerabilities before they cause serious damage.

A great starting point is Sucuri SiteCheck, a free tool that scans your website for malware, viruses, blacklisting status, errors, outdated software, and suspicious code.

For an extra layer of assurance, you should also test your site’s security headers, which help protect against attacks like XSS and clickjacking.

How to check if your WordPress site has all the recommended Security Headers.
Image: Security Headers

You can do this with Security Headers, a free scan created by security expert Scott Helme.




How to Improve WordPress Security: Conclusion

Improving WordPress security is not something you can afford to postpone.

Every single day, hundreds of bots and hackers attempt to exploit vulnerabilities in WordPress websites, and yours could easily be a target. Whether you’re a beginner just launching your first blog or an experienced site owner, taking action now is the best way to safeguard your hard work.

Stay proactive by updating plugins, monitoring threats, and following proven security practices.

By staying one step ahead, you’ll protect your content, your audience’s trust, and the future of your website.



Frequently Asked Questions About WordPress Security

Does WordPress have built-in security?

Yes, WordPress includes basic security features such as user roles, password protection, and regular updates. However, to fully secure your site, you should also use plugins, strong passwords, and server hardening.

What are the downsides of using WordPress?

The biggest downside is that WordPress is a common target for hackers. Outdated plugins, themes, or weak passwords create risks. However, with proper updates and best practices, WordPress can be very secure.

What does site hardening mean?

Site hardening means applying additional security measures to reduce vulnerabilities in your WordPress website, such as limiting login attempts, enforcing strong passwords, and configuring security headers.

What is the meaning of server hardening?

Server hardening involves securing the hosting environment of your WordPress site by updating server software, using firewalls, and restricting unnecessary services or access.

Is WordPress a safe website?

WordPress is safe when managed properly with updates, trusted plugins, and best security practices. The platform itself is secure, but poor user habits can introduce risks.

Is WordPress still insecure?

No. WordPress has significantly improved its security over the years. With regular updates and proactive measures, it is no longer considered insecure.

How do I improve WordPress website security without plugins?

You can improve WordPress website security without plugins by keeping your core updated, enforcing strong passwords, using secure hosting, and configuring file permissions properly.

What is the best way to secure a WordPress login page?

The best way is to limit login attempts, enable two-factor authentication, change the default login URL, and use CAPTCHAs to block bots.

Do I need a security plugin for WordPress?

Security plugins are not required, but they provide useful tools like malware scanning, firewall protection, and real-time monitoring that make security management easier.

Writer first, SEO specialist by accident. I manage content at Be Productive Every Day and once worked as a French–English translator. Outside the digital world, I’m usually creating art, composing music, or practicing martial arts kicks. See my author page or check out my newsletter feed for more.