Hardening Reference
SQL injection is a string-concatenation bug with a blast radius
You inherited forty plugins and no idea which of them builds its queries by gluing strings together.
The short answer
SQL injection happens when user input is concatenated into a query string, so the database receives part of the input as instructions rather than as data.
The fix is one line of technique, not a product. Send the query and the values separately — a prepared statement with placeholders — and the database can no longer be talked into treating a value as syntax. Everything else on this page is about the code you did not write and cannot fix directly.
By the HostingFast team · Reviewed 12 August 2026
100+
Definitions on file
2 min
Typical time on one
Plain
English, no marketing
24/7
Engineers on the desk
In WordPress the safe form is prepare with placeholders; in plain PHP it is PDO with bound parameters; in any modern framework the query builder does it for you unless you deliberately drop to raw SQL. The unsafe form is easy to recognise because it looks like string building: a query, a full stop, and a variable that came in from outside.
For a site owner the exposure almost always arrives inside somebody else's component. One plugin gluing a search term into a query is a route into every table on the account, including the users table. That is why the practical controls are a patching habit, a restricted database user, and a rule set in front while you wait for the fix.
The one-line difference, in code
Unsafe: the query text and the value are joined before the database sees either, so a value containing quote characters and a trailing comment marker rewrites the statement. Safe: the query text goes first with placeholders, then the values follow separately, and the database has already decided what the statement means before your data arrives.
There is no performance argument against the safe form. Placeholders parse once and can be reused, and on repeated queries a prepared statement is frequently the faster of the two. Nobody is trading speed for safety here; they are trading habit for safety.
Auditing a plugin you did not write
You can do this over SSH in a few minutes. Search the plugin tree for direct query calls and look at what surrounds them. A query built with concatenation and no preparation is your candidate; a query passed through preparation with placeholders is fine. Then check whether the values reaching it came from a request at all — plenty of concatenated queries are joining constants and are harmless.
Do this before you install, not after you are compromised. A plugin with three hundred thousand installations and an author who last shipped an update two years ago is a risk you can measure in about the time it takes to read the changelog.
Least privilege on the database user
A successful injection is limited by what the account it runs as is permitted to do. An application user does not need DROP, does not need FILE, and does not need access to any database other than its own. cPanel grants privileges per user per database, so tightening this is a panel task rather than a code change.
The plan limits are worth knowing while you are in there: 25 MySQL databases on Sprint, 50 on Turbo. That is enough headroom to give each site its own database and its own user rather than sharing one across everything, which is the arrangement that turns one compromise into several.
What the rule set covers until the patch lands
A WAF matches the shape of an injection attempt in the request and refuses it before PHP runs. That is genuine coverage for the window between an advisory going public and your update window arriving, and it costs you nothing on cached traffic because inspection never runs on a cache hit.
It is not a fix, and treating it as one is how people end up running vulnerable code for months. Neighbouring entries: WAF, Cross-Site Scripting, Database and Malware. Free SSL on every plan renews itself before expiry, so the transport half is never the thing you forgot.

Written for people who can read the code
Where a term has a code-level answer, this reference gives the code-level answer rather than an analogy about warehouses. Where it does not, it says which control substitutes and what that control misses.
SSH with Git and Composer is available on the developer-focused plans, so auditing a plugin tree is a five-minute job rather than a download.
- Code-level answers where they exist
- Panel steps where they do not
- Plan limits quoted, not implied
- Maintained by our support engineers
Why HostingFast
Standard on every plan
The bug, precisely located
Concatenation of input into query text. Everything else follows from that one sentence.
Prepared statements, no trade-off
They are as fast or faster than the unsafe form, so there is nothing to weigh up.
A plugin audit you can run
Search the tree over SSH, read what surrounds each direct query, decide before you install.
Privileges as a blast-radius control
An application user needs no DROP and no access beyond its own database. That is a panel change.
Plan limits quoted
25 MySQL databases on Sprint and 50 on Turbo — enough to stop you sharing one across sites.
Honest about the WAF
Real coverage across the disclosure gap, and no substitute at all for the update.
Quick Start
From order to online
- 1
Audit before you install
Search the plugin tree for direct query calls and check each one for preparation. Five minutes now against a database restore later.
- 2
Give each site its own user
Separate database, separate user, privileges limited to that database. The plan headroom is there to make this easy.
- 3
Patch on a schedule, not on news
WordPress Toolkit will apply core and plugin updates for you. The rule set covers the gap; the update closes it.
Built In
Loaded onto every plan
- Free SSL on every plan, renewed automatically before it can expire
- Daily backups, with self-service restores you run from the panel
- LiteSpeed caching built into the server rather than patched in by plugin
- Built-in WebP image optimisation at no extra cost
- Human support on duty every hour of every day
- In-place account upgrades — no migration when you change plan
- Your existing site moved over by our engineers, free of charge
- WordPress and 400+ other applications installed in one click
- Softaculous on board for one-click application installs
- Browser webmail plus IMAP, POP and SMTP for any mail app
Frequently Asked
What people ask us most often
How do I grep a plugin for unsafe queries?
Over SSH, search the plugin directory for direct database calls and read the surrounding lines. You are looking for query text built with concatenation where one of the pieces came from a request. Prepared calls with placeholders are fine. Constants joined together are fine. It is the combination of concatenation and request data that matters, and on most plugins the whole exercise takes under ten minutes.
Do prepared statements cost me any performance?
No, and often the reverse. The statement is parsed once and the values are sent separately, which on a repeated query is less work rather than more. If you find a benchmark suggesting otherwise, it is measuring connection overhead rather than the statement. There is no speed argument for building queries by concatenation.
Can I restrict what the database user is allowed to do?
Yes, from cPanel, per user and per database. An application user needs to read and write its own tables and nothing else — no DROP, no FILE, no access to a neighbouring site's database. That is what turns a successful injection into a bad day rather than a total loss, and it takes about a minute per site to set up.
How many databases and how much storage do the plans give?
Sprint carries 25 MySQL databases with 10 GB of storage at $2.42 a month, and Turbo carries 50 with 20 GB at $4.66, both billed annually. That is deliberate headroom for one database per site rather than a shared one, which is the arrangement that limits how far a compromise can travel.
Keep reading
Cross-Site Scripting (XSS)
Output escaping, CSP headers and why an encrypted connection does nothing for you here.
Malware
Injected code running on your account, found by timestamp, checksum and obfuscation string.
How to Test Your Website Speed
Splitting a response time into its four parts and fixing the one that is costing you.
VPS Hosting
KVM virtual servers with root access, edge filtering and one flat monthly price.
Dedicated Cloud
Reserved resources with cloud flexibility, a step up from a single virtual server.
Changing hosts? Run through our checklist first.
A straightforward sequence for a switch your visitors never feel: which files move first, how to shift email across without losing a single message, the right moment to repoint DNS, and the two mistakes behind almost all the downtime we get asked to rescue.
Run it on a stack that patches itself.
WordPress Toolkit updates, server-level rule sets, daily backups and SSH on the developer plans.
View VPS Hosting plans