Connect to FMS
You'll need
- A service key from the FMS admin portal. Get it at Service keys before you start, because it is shown only once.
- Someone who can edit
wp-config.phpon the WordPress server.
- Add the key to
wp-config.php. The exact line is below. - Fill in the FMS connection section.

- Save, then press Test FMS connection (1).

- Read the message that comes back.

What goes in each field
| Field | What to put |
|---|---|
| API URL | Where this server reaches FMS, server to server. When WordPress and FMS run on the same host, use the internal address http://fms-app:8080. |
| Public URL | Where a browser reaches FMS. This is what pricing links point at. |
| Service key | Nothing. There is no box to type in. It shows the key from wp-config.php, mostly hidden. |
| Cache TTL | How long WordPress remembers a member's access. 300 seconds is right. |
| Default fallback message | What non-members see on locked content. |
| Accent colour | The colour of the locked-content button. |
| Donations | Ticked shows the donation links. Untick to hide them. See Donations on or off. |
Add the key to wp-config.php
The key must go in wp-config.php. The plugin never saves it in the database.
Add this line to wp-config.php, above the line That's all, stop editing!:
php
define('FMS_SERVICE_KEY', 'fms_sk_…');Replace fms_sk_… with the real key. Then reload FMS Membership. The Service key field says Set via wp-config.php. That is the sign it worked.
If it says the constant is defined but empty, wp-config.php reads the key from the server's environment and that variable is not set. Set it where the server is configured (on a Docker host, in its environment file), restart, and reload. A second define() line would be ignored.
Why not in the settings screen
The key lets the website act as any member. Anyone who can read the database could do the same with a copy stored there. So the plugin keeps it out of the database.
A key is still stored in the database
Sites set up before plugin version 0.47.0 may still have the key saved in the database. It keeps working for now. Every admin page shows a warning until it is gone.
- Add the key to
wp-config.php, as above. - Reload FMS Membership. The Service key field says an old copy is still stored.
- Press Forget stored key.
- Press Test FMS connection. It should say FMS accepted the service key.
Forget the key only after wp-config.php has it
Until then the stored copy is the only one. Forgetting it disconnects the site from FMS. The button asks before it does that.
What the test can say
| Message | What it means | What to do |
|---|---|---|
| FMS accepted the service key | Everything is wired up. | Nothing. |
| Not configured | The URL or the key is missing. | Fill in the API URL and add the key to wp-config.php. |
| Could not reach FMS | No reply, or a page that is not FMS. | Check the API URL, and that FMS is running. If the URL is the public one, try the internal address. |
| FMS does not recognise this service key | Unknown or revoked. | Generate a new one in FMS. |
| FMS knows this key but refused the request | The key is fine, this server's IP is not on the allow-list. | Add the address in FMS, or clear the list. |
| Something in front of FMS answered instead | A CDN or firewall intercepted the call. Cloudflare's bot check does this to server-to-server calls. | Point the API URL straight at FMS, bypassing the CDN. On our host that is http://fms-app:8080. |
| Unexpected response from FMS | It arrived but failed. | Check the FMS logs. |
Which FMS environment the site is on
The key decides which copy of FMS the site talks to: production, or a sandbox. After a successful test, the settings page says which, under the test button.
| Line | Means |
|---|---|
| Environment: Production | The real system. |
| Environment: sandbox … — test data; links the website makes carry it | A test copy. Every link to FMS carries env= and the sandbox's name. |
| Environment: not checked yet | Press Test FMS connection. |
While it is a sandbox, the plugin's admin screens show a yellow notice. A test site needs a key generated in its own sandbox. See Service keys.
Next: choose the member pages.