WordPress.org

Ready to get started?Download WordPress

Forums

Remove duplicate scripts (3 posts)

  1. Joe
    Member
    Posted 7 years ago #

    I've been playing with YSlow and noticed that the plugin ads the JS include tag once for each ad on the page, so If I have 3 ads, I have 3 script tags pointing to http://pagead2.googlesyndication.com/pagead/show_ads.js, which YSlow is complaining about.

    Would it be possible to add logic to only include the script on the 1st banner?

  2. lcf
    Member
    Posted 6 years ago #

    Hmm.. instead of putting only on the 1st banner, I think it is better to put on the footer of the page.

  3. mutube
    Member
    Posted 6 years ago #

    As I understand it it's the show_ad.js code that actually generates the advert - if you only include it once you'll only get one ad.

    Or am I missing something? Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic