# Replacing Links issue

**URL:** https://community.kinsta.com/t/replacing-links-issue/2293
**Category:** Bug Reports
**Created:** [June 9, 2023, 12:12am UTC](https://community.kinsta.com/t/replacing-links-issue/2293 "2023-06-09T00:12:36Z")
**Posts on this page:** 17
**Page:** 1

<div class="post-metadata">

### Author: ![monofrio](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/monofrio/32/2577_2.png) [@monofrio](https://community.kinsta.com/u/monofrio)
#### Post date: [June 9, 2023, 12:12am UTC](https://community.kinsta.com/t/replacing-links-issue/2293/1 "2023-06-09T00:12:36Z")

</div>

**Q: Date/Time this occurred (Provide your time zone also)**  
**A:** 7:00pm EST

**Q: DevKinsta Version**  
**A:** 2.10

**Q: OS Version**  
**A:** 13.4

**Q: Docker Desktop Version**  
**A:** 4.19

**Q: Were any error codes or messages observed? If so, what were they?**  
**A:** no

**Q: Detailed Description of the Problem**  
**A:** I pulled database from live to local, and push the database to staging and in the processes of replacing links it also replaced all the users company email to the URL [chase.gordon@httpsstg-r3com-staging.kinsta.cloud]

I’m currently running a new sync down and pushing up to staging again to see if the issue presists.

---

<div class="post-metadata">

### Author: ![monofrio](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/monofrio/32/2577_2.png) [@monofrio](https://community.kinsta.com/u/monofrio)
#### Post date: [June 9, 2023, 12:37am UTC](https://community.kinsta.com/t/replacing-links-issue/2293/2 "2023-06-09T00:37:29Z")

</div>

The issue happened again and I needed to write a SQL script to search and replace the user’s email addresses on staging.

Looked at the local database synced and at the user table: chase.gordon@[https://r3com.local](https://r3com.local).

---

<div class="post-metadata">

### Author: ![Agus](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/agus/32/1515_2.png) [@Agus](https://community.kinsta.com/u/Agus)
#### Post date: [June 9, 2023, 3:02am UTC](https://community.kinsta.com/t/replacing-links-issue/2293/3 "2023-06-09T03:02:57Z")

</div>

Hi @monofrio ,

Thank you for reporting this issue.  
I was able to replicate it on my end as well.

I’ve checked the process in the `main.log` file on my computer, and I noticed that it seems what is happening here is: the Sync process (“pull and/or push”) of the site is running through a WP Search and Replace of the entire database (all tables) for the site to be able to viewed locally (with the .local domain URL).

This “search and replace” process also ensures that all the internal links are using something like `thesitename.local` domain to make it viewable when clicking around in the web browser. Though this WP “search and replace” process is also catching the **email@_domainname_** address if it matches the site’s domain name.

So for example, if the email in the database uses: `user@sitedomain.com` (and the live site URL is: `sitedomain.com` ), that email address would be affected during the WP search-replace process - and would be then showing this in the database: `user@https://sitedomain.local`  
(while the site domain URL would be replaced properly, like from `https://sitedomain.com` to `https://sitedomain.local` , which is correct).

As a workaround (other than with that SQL script method you mentioned), after you synced (pushed to Staging), you could also use the [“Search and Replace” tool in MyKinsta](https://kinsta.com/docs/mykinsta-search-replace-tool/) (on Staging environment) and may want to search for that _incorrect_ email address (e.g.: `chase.gordon@https://r3com.local`) and replace it with the correct email address (e.g.: `chase.gordon@domainname.com`).

Hope that helps!  
Regards,  
Agus

---

<div class="post-metadata">

### Author: ![monofrio](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/monofrio/32/2577_2.png) [@monofrio](https://community.kinsta.com/u/monofrio)
#### Post date: [June 9, 2023, 11:44am UTC](https://community.kinsta.com/t/replacing-links-issue/2293/4 "2023-06-09T11:44:47Z")

</div>

I see that as an issue if I need to constantly run a script if I need to pull to local and push to staging with the live data. I did run a SQL replace function on the user\_name table to does resolve this issue. Will there be some kind of rule to prevent the search and replace on this table. It really shouldn’t get replaced.

Thanks  
Mark

---

<div class="post-metadata">

### Author: ![Alessandro](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/alessandro/32/2310_2.png) [@Alessandro](https://community.kinsta.com/u/Alessandro)
#### Post date: [June 9, 2023, 1:10pm UTC](https://community.kinsta.com/t/replacing-links-issue/2293/5 "2023-06-09T13:10:41Z")

</div>

Hi @monofrio, once you’ll push from staging to live the email addresses will be fixed with the right domain.  
Depending on the case of use, someone would prefer a partial search and replace that excludes the email addresses (like you) while others might prefer to find any reference to a domain and replace it with something else.  
I’ll pass to our devs a feature request, perhaps this might be a setting that can be enabled/disabled with a checkbox based on the user preference. Our dev team will review and discuss the ways and means of it and see if it can be implemented one day👍

Regards,  
Alessandro

---

<div class="post-metadata">

### Author: ![monofrio](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/monofrio/32/2577_2.png) [@monofrio](https://community.kinsta.com/u/monofrio)
#### Post date: [June 9, 2023, 2:53pm UTC](https://community.kinsta.com/t/replacing-links-issue/2293/6 "2023-06-09T14:53:25Z")

</div>

Thank you, That would be great because I have my team go on the staging to build out and test on the frontend, and they need to have access to there work email addresses.

---

<div class="post-metadata">

### Author: ![ransom](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/ransom/32/2186_2.png) [@ransom](https://community.kinsta.com/u/ransom)
#### Post date: [June 29, 2023, 12:44pm UTC](https://community.kinsta.com/t/replacing-links-issue/2293/7 "2023-06-29T12:44:36Z")

</div>

I want to highlight another consequence of this issue - in addition to replacing email addresses in the site content, it appears to be replacing SMTP credentials in settings (in our case, WP Mail SMTP had the “from” address as well as the “username” settings erroneously updated).

For example: “[no-reploy@mysite.com](mailto:no-reploy@mysite.com)” had been replaced with “no-reply@[https://mysite.com](https://mysite.com)” which obviously broke production email sending.

---

<div class="post-metadata">

### Author: ![monofrio](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/monofrio/32/2577_2.png) [@monofrio](https://community.kinsta.com/u/monofrio)
#### Post date: [June 29, 2023, 1:42pm UTC](https://community.kinsta.com/t/replacing-links-issue/2293/8 "2023-06-29T13:42:08Z")

</div>

Kinsta: I’m still fixing issues with our transfer from staging to live. There really should be a rule because we also house a bunch of different subdomains as microsites, and our CRM integration and other miscellaneous links all got broken. Also, we have our main domain as naked, meaning it does have the “www” in front of it, and we found that it added this to some URLs as well. I shouldn’t have to search and replace this:

- [https://www.https](https://www.https):// → https://
- hub.https:// → hub.
- Info.https:// → info.
- and more

There needs to be some way not to have subdomains or emails affected by migration up or down from live.

Mark

---

<div class="post-metadata">

### Author: ![Alessandro](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/alessandro/32/2310_2.png) [@Alessandro](https://community.kinsta.com/u/Alessandro)
#### Post date: [June 30, 2023, 8:34am UTC](https://community.kinsta.com/t/replacing-links-issue/2293/9 "2023-06-30T08:34:40Z")

</div>

Hey Mark,

as I understand it the issue with the www appeared when you pushed from local to staging, am I correct? If so, can you please share via DM the name of the staging site so I can take a look at the action on our side?

Regards,  
Alessandro

---

<div class="post-metadata">

### Author: ![monofrio](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/monofrio/32/2577_2.png) [@monofrio](https://community.kinsta.com/u/monofrio)
#### Post date: [June 30, 2023, 3:22pm UTC](https://community.kinsta.com/t/replacing-links-issue/2293/10 "2023-06-30T15:22:48Z")

</div>

stg-r3com-staging.kinsta.cloud

---

<div class="post-metadata">

### Author: ![Alessandro](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/alessandro/32/2310_2.png) [@Alessandro](https://community.kinsta.com/u/Alessandro)
#### Post date: [July 3, 2023, 11:12am UTC](https://community.kinsta.com/t/replacing-links-issue/2293/12 "2023-07-03T11:12:01Z")

</div>

@monofrio Unfortunately the event is too old to be checked on this side. Would you be able to send us a copy of the main.log file via DM so we can review the search and replace terms? You can find it by clicking on the question mark icon at the bottom left corner of DevKinsta and then on Reveal log file in File Manager.

Regards,  
Alessandro

---

<div class="post-metadata">

### Author: ![Alessandro](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/alessandro/32/2310_2.png) [@Alessandro](https://community.kinsta.com/u/Alessandro)
#### Post date: [July 3, 2023, 11:12am UTC](https://community.kinsta.com/t/replacing-links-issue/2293/13 "2023-07-03T11:12:47Z")

</div>

Hey @ransom I’m checking this issue with our developers as I was able to replicate it on my test site. We’ll keep you posted!

Regards,  
Alessandro

---

<div class="post-metadata">

### Author: ![jakeatplace](https://avatars.discourse-cdn.com/v4/letter/j/ccd318/32.png) [@jakeatplace](https://community.kinsta.com/u/jakeatplace)
#### Post date: [February 6, 2024, 2:23am UTC](https://community.kinsta.com/t/replacing-links-issue/2293/14 "2024-02-06T02:23:27Z")

</div>

hi there. any update on options on push from devkinsta to other env’s on kinsta.cloud? from what i’ve been told the deploys within kinsta cloud do not search and replace when there’s an ‘@’ (only on domains without a preceeding @). the regex used from staging.kinsta.cloud to LIVE is “/(?\<!@)domain[.]com” - so can that be at least an option on devkinsta? having to always search/replace when using devkinsta is a broken experience.

---

<div class="post-metadata">

### Author: ![Adrian\_L](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/adrian_l/32/2810_2.png) [@Adrian\_L](https://community.kinsta.com/u/Adrian_L)
#### Post date: [February 6, 2024, 5:55am UTC](https://community.kinsta.com/t/replacing-links-issue/2293/15 "2024-02-06T05:55:11Z")

</div>

Hi @jakeatplace 👋 Welcome to the Kinsta Community!

I’m pleased to inform that as of [DevKinsta version 2.12.0](https://community.kinsta.com/t/devkinsta-releases-minor/371/16), we have successfully resolved the search and replace issue involving **@domain.com** during push/pull action. The latest [DevKinsta version, 2.13.1](https://kinsta.com/devkinsta/) is also now available for download. Moving forward, if your domain contains the “@” character before it, it will be excluded from the search and replace action.

We are confident that this update will significantly enhance your experience with DevKinsta. If you have any questions or feedback, feel free to post on this forum. We will be here to assist.

---

<div class="post-metadata">

### Author: ![jakeatplace](https://avatars.discourse-cdn.com/v4/letter/j/ccd318/32.png) [@jakeatplace](https://community.kinsta.com/u/jakeatplace)
#### Post date: [February 6, 2024, 1:37pm UTC](https://community.kinsta.com/t/replacing-links-issue/2293/17 "2024-02-06T13:37:11Z")

</div>

fantastic news! thank you!

---

<div class="post-metadata">

### Author: ![Agus](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/agus/32/1515_2.png) [@Agus](https://community.kinsta.com/u/Agus)
#### Post date: [February 7, 2024, 3:11am UTC](https://community.kinsta.com/t/replacing-links-issue/2293/18 "2024-02-07T03:11:07Z")

</div>

You’re most welcome Jake! 😄

Since the issue has been resolved in that latest DevKinsta released (mentioned above), I will mark this thread as resolved! 👍

Best Regards,  
Agus Utomo

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex020/uploads/kinsta/original/2X/8/80f8c4e56fecc02327a0964e6bf63a716483529f.png) [@system](https://community.kinsta.com/u/system)
#### Post date: [February 9, 2024, 3:11pm UTC](https://community.kinsta.com/t/replacing-links-issue/2293/19 "2024-02-09T15:11:17Z")

</div>

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
