Hiding Jetpack Ads from users who are signed in?

I’m just looking for some quick help if possible. I’ve just enabled Jetpack ads on my site, was hoping to use ad-free viewing as a Patreon reward and found the posts on hooks and conditional tags. Since the option is missing from Jetpack’s own settings, I’m assuming that pasting the hooks/tags into functions.php is the best way to do this, but I’m a bit of a novice when it comes to coding – especially PHP – and would just like to confirm that before I go making any modifications.

I’m guessing that I would use something along the lines of the following (and while I’m at it, disabling ads in the excerpt in general because they ruin my theme, haha):

if ( is_user_logged_in(true) {
add_filter( ‘wordads_excerpt_disable’, ‘__return_true’ );
add_filter( ‘wordads_content_disable’, ‘__return_true’ );
add_filter( ‘wordads_inpost_disable’, ‘__return_true’ );
add_filter( ‘wordads_header_disable’, ‘__return_true’ );

But I’m not 100% certain. Can anyone confirm, deny, and/or edit the coding so that it’s right? I’m also assuming that I can just paste it anywhere in the file, as has been the case with other database modifications I’ve seen?

Thanks so much in advance! 🙂

Read more here:: Hiding Jetpack Ads from users who are signed in?

Leave a Reply

Your email address will not be published. Required fields are marked *