Where AI Keys Live in WordPress: Auditing Plugin Settings
In WordPress, an AI key is usually pasted into a plugin’s settings page and left there. The settings page is the database. So your key is inside every backup of your site. 🗄️
This article explains where a key can live in WordPress, who can see it, where it is copied and how to audit it in an afternoon. This article covers the defender’s side only; it does not describe how to carry out an attack.
Where can a key live in WordPress?
BU BÖLÜMÜN ÖZETİ
- In a plugin setting, which means the database
- In the configuration file
- In the server’s environment variables
There are three places. Security rises in this order.

In a plugin setting, which means the database
This is the most common case. A key is pasted into the box on the plugin’s settings page; the plugin saves it in the options table of the site’s database. It is easy to set up and is the only route most plugins offer. The drawback is that the key goes wherever the database goes: backups, exports, test copies. Some plugins store the value encrypted; many store it as plain text. 🗃️
In the configuration file
The second place is the site’s configuration file. WordPress’s official documentation describes this file as one of the most important in an installation; the database connection details also live there. Some plugins allow the key to be defined in this file as a constant. The key is then in a file on the server, not in the database, and does not travel with database backups.
In the server’s environment variables
The third and soundest place is the environment variables or secrets vault offered by the hosting environment. The key sits neither in the database nor in the site files; only the running server reads it. OpenAI’s page on key safety strongly recommends environment variables as a proactive measure. Not every hosting plan offers this; where it does, it is the best choice. The general rules are in how to store an AI API key. 🖥️
Who can see the key?
BU BÖLÜMÜN ÖZETİ
- Administrator accounts
- Other plugins
- Hosting and support
A key that sits in the database can be seen by more people and tools than you might expect.
Administrator accounts
Every administrator who can open the plugin’s settings page can see or change the key. How many administrator accounts does your site have? An old agency, a former employee or an account opened for a test may still be there. Every administrator account is a copy of the key. Closing unnecessary administrator accounts is part of key security. 👥
Other plugins
In WordPress, plugins share one database. Any installed plugin can technically read the options table. With up-to-date plugins from trusted sources this is not a problem; an abandoned or vulnerable plugin is a route to your key. Do not merely deactivate a plugin you do not use; delete it.
Hosting and support
Your hosting company’s support team, an agency migrating the site, a backup service: all can reach the database. This is normal and often necessary. It is still worth knowing: if your key is in the database, it is entrusted to everyone with database access. Rotating the key when you stop working with an agency is a good habit for this reason. 🤝
Where is the key copied?
BU BÖLÜMÜN ÖZETİ
- Backups
- Test copies
- Exports and error logs
The real risk is not where the key sits but where it multiplies without anyone noticing.

Backups
Every database backup of the site contains the key. Backups may sit in cloud storage, in an email attachment or in a laptop’s downloads folder. A backup taken years ago may still carry a key that works today. According to GitGuardian’s 2026 report, 64 per cent of the secrets confirmed valid in 2022 had still not been revoked four years later. A backup ages; a key does not. 💾
Test copies
When a copy of the site is made for testing, the database is copied too, and the key with it. A test site is less protected and often forgotten. The same key is now on two sites, and the weaker one sets the risk. After a copy is made, the key on the test site should be changed. The reasons are in why the test environment is the weakest door.
Exports and error logs
Settings export files, the packages of migration plugins and some error logs can also contain the key. A log attached to a support request or a settings dump pasted into a forum can expose the key to everyone. Search the file for the key prefix before you share it. A one-minute check is shorter than a rotation. 📤
How is the audit done?
BU BÖLÜMÜN ÖZETİ
- Counting the plugins
- Looking at the page source
- Checking administrators and backups
Four steps, one afternoon. You do not need to be a developer; an administrator login is enough.
Counting the plugins
Open the list of installed plugins and mark those that use AI: chat box, content generator, translation, search, image tool. For each, ask where the key is entered and whether it is still in use. An unused plugin is deleted and its key revoked. On most sites this step turns up a forgotten key. 🔎
Looking at the page source
Open a page of your site as a visitor, view the page source and search for your provider’s key prefix. A badly written plugin may send the key to the browser. According to OpenAI, exposing a key in client-side environments such as browsers allows malicious users to take it and make requests on your behalf. If you see a key in the source, rotate it at once and replace the plugin.
Checking administrators and backups
List the administrator accounts and close those you do not recognise. Write down where backups are kept and who can reach them. A backup file in a publicly accessible folder exposes the whole site and the key together. A backup should be protected as well as the site itself. The audit as a whole is in the AI audit guide. 🧾
How is the arrangement strengthened?
BU BÖLÜMÜN ÖZETİ
- Taking the key out of the database
- A key and a cap for this site only
- Lock list: the WordPress key
The audit shows today. Three changes make tomorrow easier.

Taking the key out of the database
If your plugin allows it, define the key as a constant in the configuration file or as an environment variable. Database backups and copies then no longer carry the key. If the plugin does not allow it, ask its developer; this is also a criterion to check when choosing a plugin. A good plugin can read the key from somewhere other than the box. 🔧
A key and a cap for this site only
Give your site a key issued for that site alone, if possible in a separate workspace with its own spending cap. Do not use the same key on other sites or in automations. If it leaks, only that one is revoked and the damage is limited by the cap. One key, one site, one cap.
Lock list: the WordPress key
This article’s lock list has five lines, in order. One: count the plugins that use AI, delete the unused and revoke their keys. Two: confirm that no key is in the page source. Three: close unnecessary administrator accounts. Four: define a key and a cap for this site only. Five: where possible, move the key from the database to the configuration file or an environment variable. Where to see what the key spends is explained in where AI usage logs are kept. Forecast: AI plugins will offer encrypted storage and reading the key from a file as standard features. Update log. 30 November 2026: first publication. Forecasts on this page are re-read when they fall due; one that proves wrong is corrected here, not deleted.
How does Adapte Digital look for the key on a WordPress site?
BU BÖLÜMÜN ÖZETİ
- A single delivery package
- What is reviewed
- Where to start
In the Attack File, plugins, the page source, administrator accounts and backups are scanned in the same order.
A single delivery package
Adapte Digital does not charge a monthly management fee. Work starts with a single delivery package whose scope is written down in advance: 36,000 TRY + VAT. If the work grows, the new need is defined as a separate add-on package, priced by what will be delivered rather than by the hours spent. 📦
What is reviewed
Plugins that use AI are listed, and where their keys are stored and copied is established; each gap is written down with the setting that closes it.
Where to start
Our current packages and capacity are listed on our campaign pages; scope and price are written there before any work starts. 🧭
Quick Summary
- In WordPress a key usually sits in a plugin setting, which means the database.
- Administrators, plugins and services with database access can see it.
- The key multiplies through backups, test copies and exports.
- The audit: count plugins, view the page source, check administrators and backups.
- A site-specific key and cap limit the effect of a leak.
Short Glossary
- Options table
- The options table is the database table in which WordPress and its plugins store configuration values.
- Configuration file
- A configuration file is the server file that defines a site’s basic settings, such as its database connection.
- Constant
- A constant is a value defined once in the configuration file that does not change while the site runs.
Frequently Asked Questions
Next Step
Open the plugin list in your WordPress admin and count those that use AI. If you cannot say where the key is for each one, the audit starts here.
Sources: WordPress Developer Resources — Editing wp-config.php · OpenAI Help Center — Best practices for API key safety · GitGuardian — The State of Secrets Sprawl 2026
Updated: November 2026
Sık Sorulan Sorular
Asterisks hide it on screen only. The value may sit in the database as plain text; check the plugin’s documentation.
No; backups are necessary. Know where they are kept, restrict access, and rotate the key when you part ways with an agency or employee.
WordPress’s documentation expects it to be edited mostly under a technical person’s guidance. Ask your developer or hosting company.
