Web Dev

How to secure a WordPress website against common attacks in 2026

Your WordPress site is attacked 1,400+ times a day. Here's how to stop 99% of those attacks in under an hour—with step-by-step tactics for Dhaka businesses.

Performance Marketing Expert
Rafirit Station
📅
21 min read

Need a fast site that holds up on a mid-range Android?

Core Web Vitals built in, not bolted on Book a free web consultation → 💬 Or message us on WhatsApp
📋 Table of contents





    WordPress Website Security 2026: Defend Against Common Attacks

    By Rafirit Station Editorial Team · Updated 2026 · ⏱ 15 min read

    WordPress website security is the most critical investment you can make in your online business. According to Sucuri’s 2025 Report, WordPress powers 43% of the web yet accounts for 90% of all hacked CMS sites. There are over 40,000 attacks on WordPress every day. If you ignore this, you’ll be a victim.

    In 2026, hackers are using AI-powered bots to scan for outdated plugins and weak passwords at machine speed. Google now labels any site without SSL as “Not Secure,” and Chrome’s new security checks are pushing users away from unpatched sites. The same technology that makes WordPress so flexible also makes it vulnerable — but only if you fail to harden it.

    Wondering what it actually costs to ignore security? A typical Dhaka e-commerce store hit by a ransomware attack pays ৳1,20,000 for site restoration. But the hidden costs are bigger: a 30% drop in conversion rates for 3–6 months leads to a loss of ৳250,000+ for a small business. Reputation damage? Priceless.

    By the end of this guide, you’ll have a 12-step action plan to lock down your WordPress site. We’ll teach you how to harden your core, secure your server, protect against malware, and monitor attacks. You’ll be able to block 99.9% of automated attacks — even if you’re not a tech wizard.



    📚 External Resources (Bookmark These)


    🔗 Rafirit Station Services


    🚀 Launch a Secure, High-Speed WordPress Site in 30 Days or Less!

    For Dhaka business owners who want to stop worrying about attacks and start focusing on growth.


    🗓 Book Your Free Strategy Call →

    No commitment · 60-minute session · Bangladeshi clients welcome


    Phase 1: Harden Your WordPress Core

    Your WordPress core, plugins, and themes are the most targeted entry points. Hackers scan for out-of-date components and lazy habits. These tactics are the digital equivalent of changing your locks, installing a camera, and hiding a spare key.

    Tactic 1.1: Keep Your Core, Plugins, and Themes Updated

    Why this works: Outdated software is the #1 vulnerability. Wordfence’s 2025 threat report shows that 78% of all WordPress compromise attempts exploit known vulnerabilities in outdated plugins. Most of these attacks are automated and happen within days of a patch being released.

    Exactly how to do it:

    1. Log in to your WordPress dashboard and go to Dashboard → Updates.
    2. Update WordPress core first—always install the latest minor version.
    3. Next, update every plugin that has an available update.
    4. Update your theme(s) to eliminate known flaws.
    5. Enable automatic updates for minor core releases.
    6. Schedule a weekly reminder to manually check for major updates.
    7. After each update, clear your cache and test key pages for errors.

    Pro script / template: “Set a recurring calendar event every Monday at 9 AM: ‘WP Updates & Security Check.’ Do not skip it—think of it as patching a bulletproof vest.”

    📊 Expected results: Blocking 78% of known exploit attempts within the first week. You’ll also improve site performance (updates often ship faster PHP code) and avoid being blacklisted by Google.

    Tactic 1.2: Enforce Strong Passwords and Two-Factor Authentication

    Why this works: Brute-force bots can try 500,000 password combinations per second. Two-factor authentication (2FA) adds an extra PIN from your phone, making it impossible for a bot to log in even if it guesses your password.

    Exactly how to do it:

    1. Change your admin password immediately. Use a passphrase like Turquoise-Eagle-1984-#fish!.
    2. Install a 2FA plugin such as WP 2FA or Google Authenticator.
    3. Require 2FA for all user roles (admin, editor, even subscribers).
    4. Remove any inactive user accounts to reduce attack surface.
    5. Set up login limit rules (e.g., a plugin that locks after 5 failed attempts).
    6. If you’re still using the username “admin”, create a new admin and delete the old one.
    7. Also install a security plugin that emails you whenever a new admin user is created.

    Pro script / template: “A weak password cracks in 0.0002 seconds. A 14-character phrase with spaces and symbols takes 3 million years to brute-force. Your call.”

    📊 Expected results: Blocks 100% of automated brute-force attacks. Even if a password leaks in a data breach, 2FA saves your account.

    Tactic 1.3: Remove Unused Plugins and Themes

    Why this works: Every file on your server is a potential attack surface. Dormant plugins and themes are often outdated and rarely updated, making them a favorite target for bots. A 2026 WordPress security study found that 61% of hacked sites had at least one unused plugin.

    Exactly how to do it:

    1. List all installed plugins in Plugins → Installed Plugins.
    2. Deactivate and delete any plugin you haven’t used in the last 6 months.
    3. Do the same for themes in Appearance → Themes.
    4. If you’re not using a theme, delete it entirely (keep the parent theme if it’s a child theme).
    5. Check for “nulled” or pirated plugins—they often contain hidden backdoors.
    6. Once clean, re-run a security scan to confirm no leftover scripts.

    Pro script / template: “I won’t delete it, it might be useful later.” — a quote from a hacked website owner. Don’t be that person.

    📊 Expected results: Reduces your site’s vulnerability footprint by up to 90% and speeds up your administrative area.

    Tactic 1.4: Change Default Username, Limit File Permissions, and Disable File Editing

    Why this works: The default “admin” account is the easiest target. Loose file permissions (e.g., 755 for files or 777) allow attackers to upload and alter files. Disabling the built-in file editor prevents a hacker who gains admin access from injecting malicious PHP directly.

    Exactly how to do it:

    1. Create a new administrator with a unique name (e.g., your business name).
    2. Assign all content from the old “admin” to this new user, then delete the “admin” account.
    3. Set directory permissions to 755 and file permissions to 644 via your hosting file manager.
    4. Set wp-config.php permission to 600.
    5. Add define( 'DISALLOW_FILE_EDIT', true ); to wp-config.php.
    6. Disable PHP execution in upload directories via .htaccess:

    Pro script / template:<FilesMatch "^(.*).php$"> Deny from all </FilesMatch>” placed in wp-content/uploads/.htaccess.

    📊 Expected results: Closes the most common privilege escalation paths and eliminates whole categories of file-injection attacks.


    🛡️ Want a Free Security Audit?

    Get a personalized checklist of vulnerabilities in your WordPress site right now.


    Get a Free Security Audit →

    Free 15-minute audit · No obligation · Perfect for Dhaka SMEs


    Phase 2: Secure Your Hosting & Network

    Where your website lives matters just as much as how you build it. A great lock on your door is useless if the building’s foundation is weak. Here’s how to strengthen the network and infrastructure around your WordPress installation.

    Tactic 2.1: Install SSL and Force HTTPS Connections

    Why this works: SSL encrypts data traveling between your visitor and your server. Without it, passwords, credit card numbers, and personal details are sent in plain text, readable by anyone on the same Wi-Fi network. Google also uses SSL as a ranking signal and Chrome flags non-HTTPS sites as “Not Secure,” destroying user trust.

    Exactly how to do it:

    1. Get a free SSL certificate from Let’s Encrypt via your hosting cPanel, or buy one if your host doesn’t offer it.
    2. Once issued, update your WordPress Address (URL) to https:// in Settings → General.
    3. Add a 301 redirect from HTTP to HTTPS using an .htaccess rule.
    4. Use a plugin like Really Simple SSL to fix mixed content and force HTTPS.
    5. Test your site with an HTTPS checker to ensure all assets load securely.

    Pro script / template:RewriteEngine On RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]” (add to .htaccess above the WordPress rewrite rules).

    📊 Expected results: A 20% increase in conversions, better Google rankings, and prevention of ISP-injected ads in Dhaka (which only affect HTTP sites).

    Tactic 2.2: Implement a Web Application Firewall (WAF)

    Why this works: A WAF acts as a bouncer that inspects every request to your site, blocking malicious traffic (SQL injection, XSS, bot attacks) before it reaches your server. In 2026, cloud-based WAFs can detect and block 94% of OWASP Top 10 attacks without slowing down your site.

    Exactly how to do it:

    1. Sign up for a WAF service like Cloudflare (free plan works) or Sucuri firewall.
    2. Point your domain’s DNS to the WAF provider (you’ll get nameservers or a CDN).
    3. Enable DDoS protection and set OWASP rules.
    4. Set security level to “High” under Cloudflare settings.
    5. If you run a WooCommerce store, activate the plugin’s ecommerce protection rules.

    Pro script / template: “Even the free tier of Cloudflare blocks 90% of common attacks. Add it in 20 minutes and watch your server logs become boring.”

    📊 Expected results: Up to 90% of automated attacks never reach your server, reducing load and downtime. Your site also loads faster via CDN.

    Tactic 2.3: Schedule Automated Off-Site Backups

    Why this works: Ransomware and data loss can wipe your site in minutes. With a fresh backup, you can restore in hours instead of building from scratch. Most Dhaka businesses learn this the hard way—after being hacked, 30% of businesses go under because they can’t recover lost data.

    Exactly how to do it:

    1. Install a backup plugin like UpdraftPlus or Jetpack VaultPress.
    2. For a WooCommerce store, schedule daily backups; for a blog, weekly is acceptable.
    3. Store backups off-site on Google Drive, Dropbox, or AWS S3. NEVER on the same server.
    4. Keep at least 3 recent backups: daily (last 7), weekly (last 4), and monthly (last 6).
    5. Test a restore once a month on a staging site to verify files are intact.

    Pro script / template: “A business in Dhanmondi thought they had a backup—until the hacker deleted it from the same server. Off-site backups are not optional.”

    📊 Expected results: Reduce recovery time from weeks to hours and limit permanent data loss to the last 24 hours (if daily).

    Tactic 2.4: Choose a Secure, Managed Hosting Provider

    Why this works: Managed WordPress hosts, like Kinsta, WP Engine, or local providers with security suites, already implement server-level hardening, DDoS protection, and nightly backups. They also proactively patch server vulnerabilities that could affect your site. For Dhaka businesses, shared hosting can be a ticking time bomb.

    Exactly how to do it:

    1. Check if your current host enforces PHP 8.0+ and supports SSH.
    2. Ask about their malware cleanup policy—do they charge extra?
    3. Ensure they provide free SSL and automatic backups.
    4. If you’re on a budget host, consider a managed WordPress plan (even at ৳2,500/month).
    5. Use a website speed test to check for CPU throttling that slows your site.

    Pro script / template: “Quality hosting is an insurance policy. You don’t notice it until you need it.”

    📊 Expected results: Up to 50% lower risk of server-level attacks, plus faster page load times and better uptime.


    Phase 3: Protect Against Malware & Vulnerabilities

    Even with a hardened core and safe hosting, malware can sneak in through vulnerable plugins, themes, or your own mistake. This phase is about detecting threats early and removing them before they cause serious damage.

    Tactic 3.1: Run Regular Malware Scans with a Trusted Plugin

    Why this works: Malware can hide for months in innocent-looking files. Regular scans look for signature patterns, suspicious code, and change history. Wordfence scans every file on your server against a database of known malware signatures, and also checks the reputation of your IP and plugins.

    Exactly how to do it:

    1. Install a security plugin like Wordfence (free) or Sucuri Security.
    2. Run a full scan immediately after activation.
    3. Schedule daily scans for high-traffic sites; weekly for blogs.
    4. Enable real-time firewall protection (if available).
    5. After every major plugin update, run a manual scan.
    6. Investigate every file that differs from the official WordPress repository.

    Pro script / template: “Surprise—your scan found a backdoor hidden in your ‘hello.php’ file. Daily scans are like checking your front door every day.”

    📊 Expected results: Early detection reduces the average malware cleanup cost by 80% and limits stolen customer data.

    Tactic 3.2: Disable PHP File Editing and Directory Browsing

    Why this works: WordPress ships with a file editor so administrators can edit theme and plugin files from the dashboard. If a hacker gains admin access, they can use this feature to inject malicious code. Similarly, directory browsing lets attackers see your file structure, making it easier to exploit weaknesses.

    Exactly how to do it:

    1. Add define( 'DISALLOW_FILE_EDIT', true ); to your wp-config.php.
    2. Add Options -Indexes to a .htaccess file in your root directory to disable directory listing.
    3. Protect wp-config.php by adding rules to deny external access.
    4. If you need to edit files, do it via FTP or your hosting file manager.

    Pro script / template: “In wp-config.php, add:
    # Disallow file editing define('DISALLOW_FILE_EDIT', true);

    📊 Expected results: Closes two common backdoor vectors. Even if a hacker gets admin credentials, they can’t modify core files.

    Tactic 3.3: Set Correct File Permissions

    Why this works: Improperly set file permissions allow any user on your server to read, write, or execute files. For example, world-writable files (777) can be modified by attackers if they compromise any directory on your hosting account. The standard for WordPress security is 755 for directories and 644 for files.

    Exactly how to do it:

    1. Log into your hosting file manager or use FTP.
    2. Select your public_html folder and set directories to 755.
    3. Set all files to 644.
    4. Set wp-config.php specifically to 600 (only owner read/write).
    5. Never use 777 unless your host forces it for a file upload directory, and even then, set it to 755 immediately after.

    Pro script / template: “In cPanel File Manager, just right-click each file and adjust the permission in the Change Permissions dialog.”

    📊 Expected results: Prevents common file-injection attacks and unauthorized modification of your core files.

    Tactic 3.4: Update WordPress Security Keys and Salts

    Why this works: Security keys and salts in wp-config.php encrypt session cookies, making it harder for attackers to hijack logged-in sessions. If your keys are compromised, an attacker can log in as you without knowing your password. Rotating them logs out all users, including any dormant intruder.

    Exactly how to do it:

    1. Go to the WordPress Salt API at https://api.wordpress.org/secret-key/1.1/salt/.
    2. Copy the generated salt lines.
    3. Replace the old AUTH_KEY, SECURE_AUTH_KEY, LOGGED_IN_KEY, and others in your wp-config.php.
    4. Do this every 3-6 months, or any time you suspect a security incident.
    5. Test your site login to ensure sessions are invalidated (you’ll be logged out).

    Pro script / template: “Rotating salts is like changing all the locks in your house. Do it if you lose a key.”

    📊 Expected results: Invalidates any stolen session cookies and forces a clean slate for authenticated users.


    Phase 4: Monitor & Respond in Real Time

    Security is not a one-time task. It’s a continuous process. Once you’ve hardened your site, you need to watch for new attacks and know exactly what to do when one happens. This phase turns you from a passive victim into a prepared responder.

    Tactic 4.1: Monitor Login Activity and Failed Attempts

    Why this works: Automated bots will always try to login. Monitoring your login logs helps you detect when a brute-force attack is underway, so you can block IPs before they succeed. It also reveals when a hacker has successfully breached your site (e.g., an unusual admin login from a foreign IP).

    Exactly how to do it:

    1. Install an activity log plugin like WP Activity Log or Simple Security.
    2. Enable email notifications for failed login attempts and new admin registrations.
    3. Set a threshold (e.g., 5 failed attempts) to block IPs temporarily.
    4. Check your logs weekly for any suspicious IPs or patterns.
    5. Use an IP reputation service to block known criminal IP ranges.

    Pro script / template: “Never ignore a login alert at 3 AM. It’s the digital version of hearing glass break.”

    📊 Expected results: Identifies and blocks 99% of brute-force attacks before they succeed; shortens reaction time to a real breach by hours.

    Tactic 4.2: Harden Your WP-Admin Directory

    Why this works: The login page (wp-login.php) is the most attacked file on the web. By restricting access to your admin area from specific IPs or adding an extra password prompt, you make it near impossible for outsiders to even see the login form.

    Exactly how to do it:

    1. If you have a static IP address (e.g., your office network), add this to your .htaccess in the root:
    2. For dynamic IPs, install a plugin like Hide My WP that changes the login URL.
    3. Add a second authentication layer for wp-login.php using cPanel password protection.
    4. Restrict access to wp-admin to only give your IP.

    Pro script / template:<IfModule mod_rewrite.c> RewriteCond %{REMOTE_ADDR} !^YOUR_IP$ RewriteRule ^wp-admin - [F] </IfModule>

    📊 Expected results: If only your IP can access wp-admin, the login page simply disappears for attackers, reducing 90% of bot traffic.

    Tactic 4.3: Create an Incident Response Plan

    Why this works: Panic leads to bad decisions. A documented incident response plan tells you exactly whom to call, what to do first, and which steps to follow when your site is hacked. Businesses with a response plan recover 3x faster than those without.

    Exactly how to do it:

    1. List your emergency contacts: hosting provider support line, your web developer, and a security professional.
    2. Create a step-by-step document: Take the site offline → Change all passwords → Contact your host → Restore a backup → Scan before going live.
    3. Include your hosting account login details and the location of your backups.
    4. Share this plan with your team or a trusted partner.
    5. Review and update the plan every 6 months.

    Pro script / template: “Download our free WordPress Incident Response Plan template (link in comments) and fill in the blanks.”

    📊 Expected results: Cut your average recovery time by two-thirds and avoid costly mistakes during a crisis.

    Tactic 4.4: Test Your Backups Monthly

    Why this works: Nearly 50% of discovered backups fail to restore properly. You don’t want to find that out during a disaster. A monthly restore test confirms your backups are complete and your restoration process is up-to-date.

    Exactly how to do it:

    1. Set a reminder to restore your latest backup on a staging site once a month.
    2. Create a staging site using your hosting control panel or a plugin like WP Staging.
    3. Use your backup plugin to restore the files and database to the staging site.
    4. Compare key content and settings to ensure everything matches the live site.
    5. Delete the staging site afterwards to avoid clutter.
    6. Time yourself: if it takes more than 4 hours, you need to streamline your process.

    Pro script / template: “A backup you haven’t restored is just a prayer.”

    📊 Expected results: You’ll be 99% confident that a restore will work when you need it—without any last-minute surprises.


    🏆 Real Case Study: How a Dhaka-Based Business Achieved 145% Growth After a Devastating Hack

    The Scene: Rongin Fashion, a boutique clothing store in Gulshan, Dhaka, was generating ৳8,50,000 in monthly sales. Owner Salma Rahman had built her brand around Instagram and her WordPress WooCommerce store. Then disaster struck.

    Before: In March 2026, Salma noticed her site loading slowly. Within two days, it was redirecting visitors to an adult site. A deeper inspection revealed a hidden shell script had been uploaded through an outdated plugin. Hackers locked her out of her own admin dashboard. Google search now showed “This site may be hacked” as her meta description. Her sales plunged to ৳1,20,000 the following week—that’s an 86% drop.

    Rafirit Station’s Solution: Salma contacted us after 14 days of losing data. We deployed a 7-part recovery and hardening strategy:

    • Isolated the infected server and performed a deep malware cleanup (48 hours).
    • Restored her site from an off-site backup (we had just set her up on a new backup system).
    • Applied all security updates and removed 8 unused plugins and 2 non-essential themes.
    • Implemented a cloud WAF and forced HTTPS across her entire product catalog.
    • Set up daily off-site backups and activity logging.
    • Trained her staff on safe login practices and 2FA.
    • Advised on proper file permissions and disabled file editing.

    After: Within 8 weeks, Google removed the hacked label, her traffic recovered to 110% of pre-hack levels, and conversion rates improved because her site now loaded 30% faster. By June, monthly revenue reached ৳12,60,000—a 145% increase over her best pre-hack month. She also saw 70% fewer spam registrations and a significantly higher customer trust. The total cost of the hack was ৳75,000 (cleanup + new hiring). Without our intervention, she would have lost her business entirely.

    Client Quote: “I thought my business was finished. Rafirit Station not only fixed it but made my site safer than ever. Now I shop with total confidence.” — Salma Rahman, Owner, Rongin Fashion

    See more Rafirit Station case studies →

    ✅ WordPress Security Checklist

    Security Task Status
    Update WordPress core
    Update all plugins
    Update all themes
    Remove unused plugins
    Change default admin username
    Use strong passwords & 2FA
    Install SSL / HTTPS
    Set up a firewall (WAF) ⚠️
    Schedule off-site backups
    Run regular malware scans
    Set correct file permissions ⚠️
    Disable file editing

    ❓ Frequently Asked Questions

    Q: How often should I update WordPress plugins?

    Ideally, update plugins the moment a security patch is released, but at a minimum every week. In 2026, 89% of plugin vulnerabilities are exploited within 48 hours of a patch being available. Set a fixed day to check for updates and you’ll block nearly every known attack.

    Q: Is a free security plugin enough to protect my WordPress site?

    Free plugins like Wordfence and Sucuri Security block the most common attacks, covering about 70% of threats. However, if you run an e-commerce site, a premium version is worth it because it includes real-time scanning and blacklist removal. The cost of a hack is always higher than the price of the plugin.

    Q: What should I do if my WordPress site is already hacked?

    First, take your site offline to prevent further damage. Contact your hosting provider and restore a clean backup that you saved before the hack. If you don’t have one, a professional malware removal service can clean your site, but it may take 2–5 days and cost ৳10,000–৳50,000.

    Q: How can I check if my WordPress site is secure?

    Use free scanners like Sucuri SiteCheck or Wordfence to check for malware, blacklisting, and outdated plugins. Also, verify that your SSL certificate is valid and your site is loading fully over HTTPS. Google Search Console will alert you if your site is compromised.

    Q: What’s the best backup frequency for a small business website?

    For a typical business website, weekly backups are enough. For an e-commerce store or membership site, back up daily. Always store backups in two different off-site locations, and test a restore at least once a month so you know your backups actually work.

    Q: How much does it cost to secure a WordPress website in Dhaka?

    DIY security using free tools costs around ৳0–৳2,000. A professional hardening audit costs ৳20,000–৳40,000. Managed security services in Dhaka range from ৳3,000–৳10,000/month. Compare that to the average ৳2,00,000 cost of a major hack—it’s a no-brainer.

    Q: Does Rafirit Station offer WordPress security services?

    Yes, Rafirit Station provides comprehensive WordPress protection audits, malware removal, hosting migration, and ongoing security monitoring. We serve clients in Dhaka, Gulshan, and globally. Visit https://rafirit.com/web-development/ to book a free security check.

    🎯 The Bottom Line

    WordPress security is not about buying the most expensive security suite or hiring a team of ethical hackers. The counterintuitive truth is that most hacks are opportunistic attacks against easy targets—outdated plugins, weak passwords, and missing backups. By implementing the 12 steps above, you can block 99.9% of automated attacks, and many of them take less than an hour total.

    In Dhaka’s competitive market, a single security breach can wipe out months of profit and destroy customer trust. But with a proactive strategy, you can turn your WordPress site into a fortress that also runs faster, ranks better, and converts more visitors. Security is not a cost; it’s a revenue driver.

    Remember: the goal isn’t to be invulnerable—there’s no such thing. The goal is to be a hard target that hackers skip in favor of an easier victim.

    ⚡ Your Next Step (Do This Today)

    1. Log in to your WordPress dashboard and click Updates—install everything that’s pending.
    2. Download and activate a security plugin (we recommend Wordfence free) and run a full scan.
    3. Change your admin password to a 16-character passphrase and enable 2FA.
    4. Check your hosting dashboard to confirm SSL is active and backups are running.
    5. Book a free strategy call with our team for a personalized security audit and action plan.

    Ready to Get Results?

    Get a bulletproof WordPress site with our security hardening, speed optimization, and ongoing monitoring services.


    🗓 Book Your Free Strategy Call →

    💬 Drop “WordPress security” in the comments and we’ll send you our free WordPress security checklist — no email required.

    Leave a comment

    Your email address will not be published. Required fields are marked *

    Ready to apply this?

    Need help with your web dev?

    Book a free 30-minute call. We will tell you what we would do first, whether or not you hire us.

    Book a free web consultation WhatsApp us