How to maje sure feature images are nofollow

Posted in: Newspaper
Post count: 237

Hello

I juts found my site was giving some external dofollow links via my feature images. I cannot work out why this is happening. I get the images from Google. I then save them locally, use some resizing software and save them as a new file before publishing them. But I found I am still giving sites links via these and there is no options I can find in wordpress or the theme options that show there is any kind of URL attached to these emails.

Can you please describe a way I can make sure all my feature images will have nofollow attribute

I found some info on google. But its not clear to me what they are doing or if this is css code

Is this what I need to put into CSS customizer?

add_filter( ‘post_thumbnail_html’, ‘db_post_thumb_nofollow’, 10, 3 );

function db_post_thumb_nofollow( $html, $post_id, $post_image_id ) {
if ( is_single() || is_page() || is_front_page() ) {
return $html;
} else {
$html = ‘‘ . $html . ‘‘;
return $html;
}
}

Post count: 35449

Hi,
The above code is not a css is a function and that need to be set in functions.php, for this is recommended to use a child theme.
Unfortunately, our theme do not have an option for nofollow on feature images, so maybe the code that you found can help with this.
Thank you!

Viewing 2 posts - 1 through 2 (of 2 total)
The forum ‘Newspaper’ is closed to new topics and replies.