WordPress.org

Ready to get started?Download WordPress

Forums

How To Remove Adsense On Specific WordPress Post Without Any Plugin? (8 posts)

  1. magnumfinger
    Member
    Posted 11 months ago #

    I've been trying to remove adsense on specific posts on my wordpress blog but with no luck.

    I want to do this without using any plugin. I was wondering if someone can show me an efficient way on doing this.

    Thanks.

  2. Why not use a plugin and more importantly how are those adsense ads being added in the first place?

  3. magnumfinger
    Member
    Posted 11 months ago #

    Added through the theme on single.php.

    Plugins will mess the <div> I placed on the ads, so I'm looking for ways to do this by coding it on the theme itself.

    I've read several blogpost on Google but none worked as of the moment.

  4. magnumfinger
    Member
    Posted 11 months ago #

  5. Added through the theme on single.php.

    Which theme and where did you get it? If it's from the WordPress repo then you can ask that theme specific question in it's dedicated sub-forum.

    Plugins will mess the <div>

    They really won't, plugins are just code and run exactly the same way as placing that code in your theme's functions.php file.

    If you know where the adsense code is being added in your theme then you can wrap the whole thing in conditional tags to disable it when you want.

    http://codex.wordpress.org/Conditional_Tags

    Just make sure you create a child theme and activate it first. That way you wont be editing the original theme's files.

    http://codex.wordpress.org/Child_Themes

  6. magnumfinger
    Member
    Posted 11 months ago #

    Specific please... like the link I provided on top. Step by Step. Thanks.

  7. magnumfinger
    Member
    Posted 11 months ago #

    For example

    is_single()
    adsense code
    ...?

  8. magnumfinger
    Member
    Posted 11 months ago #

Reply

You must log in to post.

About this Topic