0

Hello friends i have this <script type="text/javascript" src="https://thompsonlaw.formstack.com/forms/js.php/tho_lionlaw_com_v2"></script> form link in many wordpress pages, i would like to either replace the link with custom link or to be able to replace "src" attr to something else to stop it from loading

please note: that i already have tried this using script_loader_tag, but it replaces all attrs instead of that specific link from pages

thanks to all in advance

6
  • i have more than 70+ pages having that link and its not easy to edit all pages to remove it so i am looking for a easy way around
    – Asad
    Nov 14, 2020 at 14:03
  • How is this being added to the pages? Is it in the post content? Via the enqueue script system? A part of the theme templates?
    – Tom J Nowell
    Nov 14, 2020 at 14:42
  • @TomJNowell its in page content in raw html avada theme is used
    – Asad
    Nov 14, 2020 at 14:48
  • I see, then this isn't something a code change can help you with, what you need is a search replace tool
    – Tom J Nowell
    Nov 14, 2020 at 14:50
  • @TomJNowell Preg_replace? or str ?
    – Asad
    Nov 14, 2020 at 14:52

1 Answer 1

0

Much like all programming, there are many ways to go about solving this. One way is using an id tag id = "script_lionlaw" (or name is whatever you want) within the script.

<script type="text/javascript" src="https://thompsonlaw.formstack.com/forms/js.php/tho_lionlaw_com_v2" id = "script_lionlaw"></script>

You could then use jquery (or some other means) to grab the tag and then replace it with whatever you want.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.