Custom Site / Redirects to Live URL?

I’m having an issue when pulling a WordPress site from Kinsta into DevKinsta. Instead of behaving like a normal pulled environment, the site shows up as a “Custom Site” and keeps redirecting to the live domain rather than staying on the local *.local URL. The files and database appear to import, but the local site won’t load correctly without redirecting externally. I’ve checked basic settings but it still seems tied to the production domain. Has anyone run into this before or know what settings or search-replace steps I might be missing to keep it fully local?

Its only 1 website. All other site pull and push correctly.

wp-config.php not updating during pull?

Adding the following work

// Force correct URL for local environment
define( ‘WP_HOME’, '‘https://url.loca’l );
define( ‘WP_SITEURL’, ‘https://url.local’ );

1 Like

Hello LeeKIJO :waving_hand:

It’s possible that you have update_option(siteurl) and update_option(home) in the theme files, code, leftover cache folder or another code that would direct to the live site.

I’m glad to hear that define override works :+1: If it’s it’s just one site with this issue, it’s unlikely that something’s wrong with your setup (DevKinsta/Docker) and more likely to be site-specific.

Please write back if you notice any other issues.

Kind regards!

Hi Vladimir,

Thank you for your reply.

update_option(siteurl) and update_option(home) hasn’t been added to funcations.php or any custom plugins. Currently there are no custom plugins on the site in question.

I will continue to use WP_HOME WP_SITEURL from the time being

Correction this method doesn’t work. Navigating to the login URL redirects back to the live domain

The only difference between the site with the issue and other is this site has WooCommerce installed

Why WooCommerce breaks on a local copy

WooCommerce stores a lot of settings and links that are tied to the site’s URL. When you copy the site to a local environment (crofts.local), those links still point to the live site. This can cause the admin dashboard to look broken, menus missing, or login not work — even if the frontend appears fine. Trying to “fix” it by changing URLs in the database can accidentally break WooCommerce settings, because some data is stored in a special format. The safe way is to keep the database as-is and use a small local configuration tweak so WooCommerce knows it’s running locally. Live site stays untouched — only the local copy is affected.

@LeeKIJO

The search-and-replace functionality in the database should be included when performing a Push/Pull site action between DevKinsta and Kinsta hosting. It’s possible that our Search and Replace script was unable to update the live site URLs due to an uninitialized class or the use of non-standard Regex syntax in the domain entries. You may provide us with the live site domain so we can investigate further. Alternatively, you can try to manually run a Search and Replace using WP-CLI within Docker Desktop.

Thank you!

Hi Adrian,

The website isn’t live but is using the live environment for development.

Do you require logins ETC and if so how can I securely send them to you?

Hi @LeeKIJO

You can send me the current domain being used on the site you’re trying to pull from the Kinsta server via private message. No need to send me any login info.

@LeeKIJO,

Thank you for sharing the domain of the Kinsta site you’re trying to pull into DevKinsta. I reviewed the domain entries in its database, and it seems they are using a Regex format for the domain entries:

'https:\/\/domain.com'

Due to this unique format, the search and replace function when pulling or pushing sites will not include these entries. This format appears to be managed through Elementor, which has a built-in Search and Replace feature. Unfortunately, when you pull or push the site between DevKinsta and the Kinsta server, you will need to perform an additional Search and Replace using Elementor to ensure that no leftover entries from the source domain remain.

Hi Adrian, this still won’t work for me.

Even when I add the following to wp-config.php I still cannot login to perform the Elementor search and replace. I am continuously redirected to the Live domain.

define( ‘WP_HOME’, ‘https://crofts.local’ );
define( ‘WP_SITEURL’, ‘https://crofts.local’ );

I also not had this issue with other sites expect those that have WooCommerce Installed. This wasn’t an issue until a month or so ago.

Hi Adrian,

When I try login using the custom login URL it redirects to Live.

When I use the default wp-admin it works.

Not sure if this information helps?

Not sure if I already mentioned this but the site appears as a Custom site rather than WordPress 6.9.1 etc

Hi @LeeKIJO

This information is very helpful.

It could be that the custom login setting is still referencing the live domain in the database. Since custom login URLs are typically managed by plugins, they may contain domain entries in formats that are not automatically replaced during the DevKinsta pull process and the reason why accessing the custom login URL redirects to the live site, while /wp-admin works normally.

Also, are you able to provide the lastest main.log file from DevKinsta and send it here? Troubleshooting - Error Codes - Kinsta® Docs

Looking forward to your response.

Hi,

I don’t appear to have a main.log file within the logs directory.

There is a _access.log and _error.log for all my local sites, 1 xdebug.log and some fpm.logs

Hi Lee,

Thank you for the response.

Sorry, what I meant was the main.log file for DevKinsta.
You can find it on the Help and Support page in DevKinsta, refer to the screenshot below:

We will wait for your update. Thank you.

Hi Merineth,

I have direct messaged you both main.log and main.old.log.

I have also tried deleting WooCommerce and then pulling the site to DevKinsta. The site still appears as custom site and is unusable. I have attached a screenshot here of the wp-config file which is defiantly incorrect. Even upon correcting it the site redirects to the live website.

Anything else please let me know.

Hello @LeeKIJO :waving_hand:

Please message me as well the main.log so I can recheck. Apologies for the back and forth.

Kind regards!