Plugin Support
Alex
(@fellan91)
Hello,
Visual Portfolio renders HTML links around gallery images even when Popup & Lightbox is enabled. Here’s why:
- Accessibility: The plugin keeps real links for users with disabled JavaScript or assistive technologies
- Structure: Each image has an tag linking to the full-resolution file
- JavaScript Handling: The popup/lightbox opens when users click images, but SEO tools only see the HTML links
- Missing Attributes: Gallery links lack rel=”nofollow”, causing search engines to count them as internal links
Solutions
Here are two approaches to resolve this issue:
Option 1: Use Pagination
Split images across multiple pages:
Option 2: Add rel=”nofollow” Using Code Snippets Plugin
This solution tells search engines to ignore gallery links while maintaining functionality:
Install Code Snippets Plugin
- Go to Plugins → Add New
- Search for “Code Snippets”
- Install and activate
Add Custom Code
- Navigate to Snippets → Add New
- Title it “Add nofollow to Visual Portfolio Gallery Links”
- Add this code:
add_filter('the_content', 'add_nofollow_to_vp_gallery_links', 20);
function add_nofollow_to_vp_gallery_links($content) {
if (strpos($content, 'vp-portfolio__item-img') === false) {
return $content;
}
$content = preg_replace(
'/<a([^>]*class="[^"]*vp-portfolio__item-img[^"]*"[^>]*)>/i',
'<a$1 rel="nofollow">',
$content
);
return $content;
}
Implement and Test
- Save and activate the snippet
- Inspect gallery images to verify rel=”nofollow” is present
- Confirm popup/lightbox functionality
- Re-run SEO analysis
Regards,
Alex
-
This reply was modified 3 months, 3 weeks ago by
Alex.
Amazing Alex!
Did that!
Thank you so much!
Great plugin guys and support,
Warm regards, Artur.