Add NoFollow to Custom Links

If you are using custom URL’s for your gallery thumbs, then you might also want to make those links nofollow, so that search engines do no crawl those links from your site.

To add this functionality, simply add the following code snippet to your functions.php file:

add_filter( 'foogallery_attachment_html_link_attributes', 'foogallery_nofollow_links', 10, 3 );

function foogallery_nofollow_links($attr, $args, $foogallery_attachment) {
  	if ( 'custom' === $args['link'] && !empty($foogallery_attachment->custom_url) ) {
	  $attr['rel'] = 'nofollow';
	}
	return $attr;
}

Please note that you will need to set your gallery “Link To” setting to use custom URL’s:

Set link to Custom URL

Resources

Find the right next step

Use this grid for documentation indexes, support routes, account links, affiliate resources, and download pages.

Documentation

Search setup guides, product docs, and troubleshooting articles.

Support

Open a ticket with product details so we can help quickly.

Licensing

Review account, renewal, refund, and license information.

Pricing update

Monthly & Lifetime plans are currently not unavailable

We’re not offering these payment options right now. Leave your name and email and we’ll let you know as soon as they return.

NameEmailNotify Me

No spam - Unsubscribe anytime