Title: Cannot find/replace complex URLs
Last modified: November 16, 2023

---

# Cannot find/replace complex URLs

 *  Resolved [the5krunner](https://wordpress.org/support/users/the5krunner/)
 * (@the5krunner)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/cannot-find-replace-complex-urls/)
 *  URLs like this cannot be searched and replaced: [https://www.domain.com/?utm_source=MYidentifier&utm_medium=b&utm_campaign=r](https://www.domain.com/?utm_source=MYidentifier&utm_medium=b&utm_campaign=r)
 * I’m guessing maybe it’s the & or ? characters?
 * Do I need to use parentheses? ie “[https://www.stryd.com/?utm_source=tfk&utm_medium=b&utm_campaign=r&#8221](https://www.stryd.com/?utm_source=tfk&utm_medium=b&utm_campaign=r&#8221);
 * i’m just looking at WP_POSTS and did a dry run
 * any help appreciated
    -  This topic was modified 2 years, 6 months ago by [the5krunner](https://wordpress.org/support/users/the5krunner/).
    -  This topic was modified 2 years, 6 months ago by [the5krunner](https://wordpress.org/support/users/the5krunner/).
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fcannot-find-replace-complex-urls%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Support [Delicious Brains Support](https://wordpress.org/support/users/dbisupport/)
 * (@dbisupport)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/cannot-find-replace-complex-urls/#post-17207134)
 * Hi there,
 * Better Search Replace Support Team here, Thanks for reaching out with your query
   we would be happy to assist
 * I just tried this on my end and I was able to replicate the issue. Seems like
   it’s an issue with the “&”. It was due to it being encoded when stored in the
   database. The “&” was replaced with “\0026”
 * For example: [https://www.domain.com/?utm_source=MYidentifier](https://www.domain.com/?utm_source=MYidentifier)\
   u0026utm_medium=b\u0026utm_campaign=r
 * Once I copied that URL from my database and paste it on the search field of the
   plugin, it was able to find the URL.
 * With that in mind, you can try replacing the “&” character with \u0026 and see
   if that helps. If the issue persists, I recommend checking your WordPress database
   and see how that URL is stored and encoded.
 *  Thread Starter [the5krunner](https://wordpress.org/support/users/the5krunner/)
 * (@the5krunner)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/cannot-find-replace-complex-urls/#post-17207492)
 * hey thank you, that doesn’t work. i’m not sure if the “?” character is also a
   factor? (I don’t think it is, I think the ? works OK)
 * I am using standard wordpress tables WP_POSTS. I have no idea how to investigate
   the inate structure of out-of-the-box wordpress.
 * just to be clear
 * i replace
 * &
 * with
 * \u0026
 * or is it replacing with
 * \0026
 * this is the exact link [https://www.stryd.com/?utm_source=tfk&utm_medium=b&utm_campaign=r](https://www.stryd.com/?utm_source=tfk&utm_medium=b&utm_campaign=r)
    -  This reply was modified 2 years, 6 months ago by [the5krunner](https://wordpress.org/support/users/the5krunner/).
    -  This reply was modified 2 years, 6 months ago by [the5krunner](https://wordpress.org/support/users/the5krunner/).
 *  Plugin Support [Delicious Brains Support](https://wordpress.org/support/users/dbisupport/)
 * (@dbisupport)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/cannot-find-replace-complex-urls/#post-17215425)
 * Hi [@the5krunner](https://wordpress.org/support/users/the5krunner/),
 * Thanks for the response.
 * **hey thank you, that doesn’t work. i’m not sure if the “?” character is also
   a factor? (I don’t think it is, I think the ? works OK)**
 * >On my end the “?” was not a factor, only the “&”.
 * But this is on my end only. Your WordPress database may be encoding the characters
   differently which means that while “?” is not encoded on my end, it may be for
   yours.
 * **just to be clear i replace “&” with “\u0026”**
 * >Yes.
 * Here’s what I would input on the search field using your example – [https://www.stryd.com/?utm_source=tfk\u0026utm_medium=b\u0026utm_campaign=r](https://www.stryd.com/?utm_source=tfk&utm_medium=b&utm_campaign=r)
 * That said, if that’s still not being detected, kindly confirm first if that URL
   is indeed stored on your “wp_posts” table. It may be residing on a different 
   database table.
 * If it’s there, I would then recommend checking how that URL is stored exactly.
   You may use something like phpMyAdmin to check your database.
 * For assistance regarding accessing your WordPress database, I recommend reaching
   out to your hosting provider as they may be able to assist you further with this.
 *  Thread Starter [the5krunner](https://wordpress.org/support/users/the5krunner/)
 * (@the5krunner)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/cannot-find-replace-complex-urls/#post-17216042)
 * OK I managed to solve it
 * my hosting comapny informed me that i used one of these character sets:
 * _wp1 – wp_posts – utf8_general_ci
   _wp4 – wp_posts – utf8mb4_unicode_520_ci
 * i then dont think that helped me too much.
 * but then I tried this which worked:
 *  [https://www.stryd.com/?utm_source=tfk&amp;utm_medium=b&amp;](https://www.stryd.com/?utm_source=tfk&utm_medium=b&)
 * ie the & amp and ; characters (3 bits of info)
 * i coudl then successfuly replce that with an easier to maange string

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Cannot find/replace complex URLs’ is closed to new replies.

 * ![](https://ps.w.org/better-search-replace/assets/icon-256x256.png?rev=2706527)
 * [Better Search Replace](https://wordpress.org/plugins/better-search-replace/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/better-search-replace/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/better-search-replace/)
 * [Active Topics](https://wordpress.org/support/plugin/better-search-replace/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/better-search-replace/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/better-search-replace/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [the5krunner](https://wordpress.org/support/users/the5krunner/)
 * Last activity: [2 years, 6 months ago](https://wordpress.org/support/topic/cannot-find-replace-complex-urls/#post-17216042)
 * Status: resolved