Title: Replacing ad code
Last modified: September 19, 2017

---

# Replacing ad code

 *  Resolved [E.S. Ely](https://wordpress.org/support/users/es-ely/)
 * (@es-ely)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/replacing-ad-code/)
 * Marios
    I long used your real time search and replace plugin to redirect ad code,
   swapping out one url for another, and it worked great. Now I am trying to replace
   chunks of ad code on my homepage and I’ve run into difficulty. I’ve check the
   ad code with the ad support guy to make sure I had it right. But when I attempt
   to replace it, it doesn’t work. The funny thing is that in an earlier try I had
   some success. I’ll appreciate any help you can give me. It’s a great plugin.
 * Gene
 * Here is the ad code:
    <script type=”text/javascript” > <!– var browName = navigator.
   appName; var browDateTime = (new Date()).getTime(); var browVersion = parseInt(
   navigator.appVersion); var ua=navigator.userAgent.toLowerCase(); var adcode=”;
   if (browName==’Netscape’){ if (browVersion>=5) { document.write(‘<ifr’+’ame src
   =”[http://www.medialifemagazine.com:8080/banman/a.aspx?ZoneID=65&Task=Get&Browser=NETSCAPE6&SiteID=1&X=&#8217](http://www.medialifemagazine.com:8080/banman/a.aspx?ZoneID=65&Task=Get&Browser=NETSCAPE6&SiteID=1&X=&#8217);
   + browDateTime + ‘” width=300 height=250 Marginwidth=0 Marginheight=0 Hspace=
   0 Vspace=0 Frameborder=0 Scrolling=No></ifr’+’ame>’); } else if ((browVersion
   >=4)&&(ua.indexOf(“mac”)==-1)) { document.write(‘<s’+’cript src=”[http://www.medialifemagazine.com:8080/banman/a.aspx?ZoneID=65&Task=Get&Browser=NETSCAPE4&SiteID=1&X=&#8217](http://www.medialifemagazine.com:8080/banman/a.aspx?ZoneID=65&Task=Get&Browser=NETSCAPE4&SiteID=1&X=&#8217);
   + browDateTime + ‘”>’); document.write(‘</’+’scr’+’ipt>’); document.write(adcode);}
   else if (browVersion>=3) { document.write(‘[](http://www.medialifemagazine.com:8080/banman/a.aspx?ZoneID=65&Task=Click&Mode=HTML&SiteID=1&PageID=&apos; + browDateTime + &apos;&RandomNumber=&apos; + browDateTime  + &apos;)‘);}}
   else { document.write(‘<ifr’+’ame src=”[http://www.medialifemagazine.com:8080/banman/a.aspx?ZoneID=65&Task=Get&SiteID=1&X=&#8217](http://www.medialifemagazine.com:8080/banman/a.aspx?ZoneID=65&Task=Get&SiteID=1&X=&#8217);
   + browDateTime + ‘” width=300 height=250 Marginwidth=0 Marginheight=0 Hspace=
   0 Vspace=0 Frameborder=0 Scrolling=No></ifr’+’ame>’); } // –> </script>
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Freplacing-ad-code%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  Plugin Author [Marios Alexandrou](https://wordpress.org/support/users/marios-alexandrou/)
 * (@marios-alexandrou)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/replacing-ad-code/#post-9511059)
 * I don’t have any tricks up my sleeve 🙂 When I run into trouble I just work my
   way from a small match to a more complex match until I find where the issue is.
   So in your case I’d try to match a word then a line and then multiple lines.

Viewing 1 replies (of 1 total)

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

 * ![](https://ps.w.org/real-time-find-and-replace/assets/icon-256x256.png?rev=1347950)
 * [Real-Time Find and Replace](https://wordpress.org/plugins/real-time-find-and-replace/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/real-time-find-and-replace/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/real-time-find-and-replace/)
 * [Active Topics](https://wordpress.org/support/plugin/real-time-find-and-replace/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/real-time-find-and-replace/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/real-time-find-and-replace/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Marios Alexandrou](https://wordpress.org/support/users/marios-alexandrou/)
 * Last activity: [8 years, 8 months ago](https://wordpress.org/support/topic/replacing-ad-code/#post-9511059)
 * Status: resolved