Title: Replacing custom HTML code
Last modified: January 20, 2025

---

# Replacing custom HTML code

 *  Resolved [Lazza](https://wordpress.org/support/users/lazza/)
 * (@lazza)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/replacing-custom-html-code/)
 * The Divi page builder does not use an `iframe` for Google Maps, rather it invokes
   custom JS code that includes several `div` elements in the page.
 * This conflicts with the usual (expected) behavior of the plugin which only targets
   frame elements and embeds.
 * I am trying to add a custom provider and, for the sake of testing, I am attempting
   to use very simple HTML regular expressions to replace some code with the Embed
   Privacy code. After this first test will be completed successfully, I will update
   the regex to match the div containing the actual map.
 * Nevertheless, even super simple expressions such as `<p>HELLO<.p>` are not replacing
   the `<p>HELLO</p>` paragraph in my test page.
 * How can I ensure that a custom embed provider, added from the WP backend, replaces
   some HTML code correctly?
 * Thank you!
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Freplacing-custom-html-code%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [Matthias Kittsteiner](https://wordpress.org/support/users/kittmedia/)
 * (@kittmedia)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/replacing-custom-html-code/#post-18255006)
 * Hi [@lazza](https://wordpress.org/support/users/lazza/)!
 * Not matching the paragraph while using the regular expression `/<p>Hello<\/p>/`
   is actually a bug, which I could reproduce and will fix in the next version, 
   thank you for noting (this happens if the regular expression contains an HTML
   tag other than `iframe`, `object` or `embed`, which is then handled differently).
 * Loading the Google Maps script properly is a whole different story. There’s definitely
   custom PHP and JavaScript code required to actually load the script only if consent
   is given. I’ll add it to the list of upcoming features, as I couldn’t get it 
   fully working the last hour.
 * Best regards,
   Matthias
 *  Thread Starter [Lazza](https://wordpress.org/support/users/lazza/)
 * (@lazza)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/replacing-custom-html-code/#post-18256641)
 * Thank you for the quick reply!
 * > There’s definitely custom PHP and JavaScript code required to actually load
   > the script only if consent is given.
 * This is understandable. I don’t mind if I have to write some custom code snippet
   to get it all right.
 *  Plugin Author [Matthias Kittsteiner](https://wordpress.org/support/users/kittmedia/)
 * (@kittmedia)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/replacing-custom-html-code/#post-18324337)
 * I’ve released version 1.10.10, which includes both fixes: handling regular expressions
   and loading Google Maps in Divi.

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

The topic ‘Replacing custom HTML code’ is closed to new replies.

 * ![](https://ps.w.org/embed-privacy/assets/icon.svg?rev=2812349)
 * [Embed Privacy](https://wordpress.org/plugins/embed-privacy/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/embed-privacy/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/embed-privacy/)
 * [Active Topics](https://wordpress.org/support/plugin/embed-privacy/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/embed-privacy/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/embed-privacy/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Matthias Kittsteiner](https://wordpress.org/support/users/kittmedia/)
 * Last activity: [1 year, 3 months ago](https://wordpress.org/support/topic/replacing-custom-html-code/#post-18324337)
 * Status: resolved