Skip to content Skip to sidebar

This thread is resolved. Here is a description of the problem and solution.

Problem:
The client was experiencing issues with the WPML sitekey on their staging site, which was set up as a copy of the production site. They were unable to use the same sitekey for both environments due to their deployment process, which overwrites the production database with the staging database.
Solution:
We advised the client to register separate sitekeys for their production and staging sites. This can be done by unregistering WPML on the staging site through Plugins -> Add New -> Commercial and then registering it with a new sitekey. Additionally, we recommended coding the sitekeys into the

wp-config.php

file for easier management between environments. Detailed steps for this process can be found here: Automatic WPML Registration Using PHP.
For sharing translation credits between staging and production, we provided guidance on setting up an automatic translation subscription for multiple sites, which can be accessed here: Automatic Translation Subscription for Multiple Sites.

If this solution does not resolve your issue, or if it seems outdated or irrelevant to your specific case, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. Should you need further assistance, please do not hesitate to open a new support ticket at WPML Support Forum.

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 5 replies, has 3 voices.

Last updated by Bobby 1 year, 11 months ago.

Assisted by: Bobby.

Author Posts
May 10, 2024 at 3:39 pm #15615684

resoluteD

I previously had the staging site [removed] setup as a copy of [removed] and it was working as expected until today when I was getting a notification on both staging and prod that the sitekey is incorrect. I created a new site key for hidden link and it's fine on prod, but I can't use that same site key on staging. At some point the pop up prompting me to select "Yes this is a copy" came up, and when I clicked "yes this is a copy" it took me to the plugin page. I tried to enter the site key for prod and I continue to get a message. I can't see any other way to set this up as a copy of prod. I also can't use a new sitekey for staging because we our deployment process replaces the DB on prod with the DB from staging.

May 10, 2024 at 7:46 pm #15616260

Lauren

Thank you for contacting WPML support. While you are waiting for one of my colleagues to take this ticket and work on it, let me provide you with first debugging steps or if I can perhaps help with the issue quickly.

Both your production site and your development site should have separate site keys, since they are separate domains. Please register each domain at wpml.org/account/sites.

On your staging site, you can then go to Plugins -> Add New -> Commercial and click the link to unregister WPML. YOu will then see the link to Register WPML, where you should add the site key for the development site.

You can also code the site keys into the wp-config file: https://wpml.org/faq/automatic-wpml-registration-using-php-for-easy-moves-between-production-development-and-staging/

Please let us know if you need any further assistance and we will be happy to help.

May 13, 2024 at 3:52 pm #15621784

resoluteD

Hi Lauren
Thanks for the additional information. I did read about getting another sitekey for the staging site however we deploy by pushing the DB from staging to production. If I create a different sitekey for staging, the production sitekey will get overwritten with the staging sitekey due to our deployment process. When I initially created the staging site I had the option to set it up as a "copy" of production. I believe it did have the same sitekey when it was setup as a copy? I didn't have to create a new sitekey for it. It seemed to be working correctly until I got prompted on both production and staging that I needed a new sitekey (not sure what happened there). Likewise, translations and copy will only be updated on staging and then pushed to production. So it is possible to get it setup as a copy with the same sitekey and have them share the credits?

May 14, 2024 at 12:14 am #15622700

Bobby
WPML Supporter since 04/2015

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Hi there,

Please note that the sitekey to register WPML is different from your ATE account id which is what the prompt you got synchronizes.

sitekey -> this is used to register your product with wpml.org and it allows you to get the latest versions of WPML, etc.

ATE account key -> this is used for your automatic translation and the translation memory.

#1 You cannot register 2 sites with the same key which is why we recommend using a staging key, but yes once you push the dev site to the live site you will need to update this.

Since you are frequently moving from staging to live we recommend registering the site in a programmatic way as shown here:
https://wpml.org/faq/automatic-wpml-registration-using-php-for-easy-moves-between-production-development-and-staging/

#2 You can connect your staging and live sit to use the same account for automatic translation to use the same credits using these steps:
https://wpml.org/documentation/automatic-translation/automatic-translation-subscription-for-multiple-sites/

Let me know your results, please.

May 14, 2024 at 6:22 pm #15626773

resoluteD

Hi Bobby

Thanks for your help! This is now resolved! I can see that credits are shared between staging and production and I set the sitekey in the wp-config file for each environment. Everything is working perfectly so far.

I realize I made this question public and I have included our staging URL in the original question. Is it possible to make this private? If not, can you remove both the staging and production URL's from my original question?

Thanks,
Sandra

May 16, 2024 at 12:50 am #15632524

Bobby
WPML Supporter since 04/2015

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Hi Sandra,

Glad to hear the issue has been resolved, the URLs have been removed now.