← Back to Insights
Security5 min read

PHP and WordPress: Protect first, modernise selectively

Short answer

Put your public website behind a WAF and restrict backend access. Replace customer-facing pages first, then review your plugins and who handles security updates.

Published

The UK's National Cyber Security Centre expects AI to shorten the time between a vulnerability becoming public and attackers exploiting it. Read the NCSC assessment.

Put the public website behind a web application firewall, or WAF, with no public admin pages. Restrict backend access, preferably managed by your hosting provider. Then modernise the website in parts.

What is WAF?

A web application firewall, or WAF, inspects incoming web requests and blocks those that match malicious patterns. It can examine the requested URL, headers and submitted data. Its rules help filter attacks, but cannot guarantee that every allowed request is safe. How a WAF works.

A basic network firewall checks IP addresses, ports and protocols. A WAF examines what the request asks the website to do. A number plate check is like the network firewall; police checking whether the driver is under the influence is like the WAF.

Put a WAF in front

Route public website traffic through the WAF. Have your hosting provider restrict the website server to authenticated connections from that service, using a private tunnel or access controls. Test that visitors cannot bypass it by connecting directly to the server. Origin protection options.

Choose managed WAF rules with ongoing updates, and check what your plan covers. Test forms, checkout, payment callbacks and customer logins before switching traffic. Keep carts, accounts and checkout responses out of shared caches.

Continue patching PHP, WordPress, plugins and themes. A WAF cannot repair vulnerable code or clean an already compromised website.

Where do we start?

Start with the pages your customers see. Publish them as static pages where possible. For live data, use a small frontend server that fetches only the required information from your private WordPress backend.

Visitors request the new frontend through the WAF. The frontend requests selected data from WordPress on their behalf. Allow only defined operations, such as reading published product details, and keep backend credentials on the server. Do not build a proxy that forwards arbitrary visitor requests to WordPress.

This exposes fewer WordPress functions to visitors. The retained backend still needs security updates and access controls.

Keep administration private

The public frontend should have no WordPress administration or login routes. Give authorised staff a separate access gateway or VPN with multi-factor authentication. Ask the hosting provider to manage that access and restrict the backend to the frontend service and authorised administrators.

Map customer actions and integrations separately. Checkout, customer accounts and payment callbacks need specific, authenticated routes where appropriate. Renaming an admin URL alone does not restrict access.

Then review plugins

List every plugin your website uses, including add-ons and custom plugins. Record what each does, who uses it, what data it holds and which systems it connects to.

Plugins add functionality to WordPress. Examples include WooCommerce for ecommerce, Contact Form 7 for enquiry forms and Yoast SEO for search optimisation.

Use that list to find modern, actively maintained services or applications that cover the functions you still need without WordPress. Check recent releases, security support and compatibility. A replacement platform may cover several plugins' functions. Test complete workflows, such as payment through to stock updates and refunds, before choosing it.

Replace one part at a time. Preserve URLs or add redirects, test in staging, and keep a rollback plan. Continue patching any WordPress components you retain.

Choose who handles updates

  • For managed services, confirm which security updates the provider installs automatically and what its support covers.
  • For custom code, automate dependency update proposals and checks. Deploy tested updates with a rollback path.
  • Assign an owner for failed updates, security alerts and urgent patches. Test backup restoration.

What to focus on

AreaFocus
Public WordPress pagesStatic pages or a frontend server that fetches selected data from the private backend, behind a WAF.
WordPress administrationProvider-managed private access with multi-factor authentication.
Plugins and add-onsInventory their functions, then choose actively maintained replacements that cover the workflows you need.
Custom PHP workflowsReplace individual functions and test their connections to other systems.
External integrationsMap accounting, inventory, payment and delivery connections. Test data transfers and assign someone to failed syncs and reconciliation.
Post-migration maintenanceAgree who handles updates, backup restoration tests and incidents after launch. Confirm automatic update coverage, support hours and rollback procedures.
Monitoring and alertsIf you have no alerting, consider monitoring for website outages, server errors and low disk space. Send alerts to named responders and test delivery.

Questions before choosing a replacement

Questions for the ownerQuestions to ask the modernisation provider
Do you want to migrate existing data or start fresh? Which older records must remain accessible?Which data will you migrate or archive, and what will stay in the old system? How will you check the migration and keep required records accessible?
Are your workflows documented, or can your team describe them, including exceptions?Can you demonstrate each required workflow in the replacement? What will change or need custom work?
Which external systems must the website work with, such as accounting, inventory, payments or delivery?Can you integrate with those systems? Who handles failed transfers and reconciliation?
Which plugin functions do staff and customers still use?Which functions are built in, need an add-on or require custom code? Who maintains each part?
How much downtime can you accept, and who can test the new site?How will you test the move, handle data changed during cutover and roll back if it fails?
Who will own the accounts and maintain the site after launch?What security updates, backups and incident support do you provide? Will we control the domain, hosting and data, and be able to export our data if we leave?
Do you receive alerts when the website or server has a problem? Who should respond, including outside working hours?What will you monitor, how will you notify us, and who responds? Can you test an alert and explain what happens if nobody acknowledges it?
What can you spend on the migration and ongoing operation?What are the migration, subscription, support and integration costs? Which changes cost extra?
Was this useful?

Need help protecting or replacing your PHP website?

Tell us about your website

Book a free 30-minute call