Fixed Google reports lacking canonical tag on /media/1234/preview

Alpha1

Well-known member
Affected version
1.1.17
Google Search Console states the problem that all media preview pages are a 'Duplicate without user-selected canonical'

We have 42k entries so I hope that this issue can be addressed.
 
I added nofollow to them some time ago (if you want i can send you the template adjustments):

- media pages -> '?lightbox=1' and 'show full size' links

- media index pages -> lightbox and preview links

Also added these to sorting links and noindex to 'album index' and 'media/user' pages because rel=canonical is missing on those (you can also add that).

Some attachments in posts will also give the same problem in the new console because of the url format i think but this has decreased on my console (google figures it out). Also when thumbnails are inserted in posts you also get 2 url's, i nofollow 1 but that is not a big problem.
 
This is for the preview pages ;) (and lightbox, same)

template -> xengallery_media_thumb_item
Code:
<xen:if is="{$item.media_type} == 'image_upload' AND @xengalleryThumbShowPreview">
                            <a href="{xen:link xengallery/full, $item, 'lightbox=1'}" rel="nofollow" class="mfp-image Lightbox JsOnly Tooltip" data-type="image" title="{xen:phrase xengallery_preview}" data-media-title="{$item.media_title}" data-media-url="{xen:link xengallery, $item}" data-username="{$item.username}" data-user-url="{xen:link 'xengallery/users', $item}"><span class="mediaLabel labelStandard"><i class="fa fa-search-plus"></i></span></a>
                        </xen:if>

                        <xen:if is="({$item.media_type} == 'video_embed' OR {$item.media_type} == 'video_upload') AND @xengalleryThumbShowPreview">
                            <a href="{xen:link xengallery/preview, $item}" rel="nofollow" class="mfp-iframe Lightbox JsOnly Tooltip" data-type="iframe" title="{xen:phrase xengallery_preview}" data-media-title="{$item.media_title}" data-media-url="{xen:link xengallery, $item}" data-username="{$item.username}" data-user-url="{xen:link 'xengallery/users', $item}"><span class="mediaLabel labelStandard"><i class="fa fa-play"></i></span></a>
                        </xen:if>
 
And on the media pages you also go preview and lightbox. I also added it to the full image link because it is already on the page (image itself).

template -> xengallery_media_view_toolbar
Code:
<xen:if is="{$media.media_type} == 'image_upload'">
                <a class="button smallButton toolButton Tooltip" title="{xen:phrase xengallery_fullsize_media}" href="{xen:link xengallery/full, $media}" rel="nofollow"><i class="fa fa-search-plus fa-lg"></i></a>
                <span class="LightboxContainer" data-fetch-url="{xen:link xengallery/fetch, $media}" data-total-count="{$containerCount}">
                    <a href="{xen:link xengallery/full, $media, 'lightbox=1', 'last_edit_date={$media.last_edit_date}'}" rel="nofollow" class="mfp-image Lightbox JsOnly button smallButton toolButton Tooltip" title="{xen:phrase xengallery_view_media_in_lightbox}" data-type="image" data-media-title="{$media.media_title}" data-media-url="{xen:link xengallery, $media}" data-username="{$media.username}" data-user-url="{xen:link 'xengallery/users', $media}"><span></span><i class="fa fa-picture-o fa-lg"></i></a>
                </span>
            <xen:else />
                <span class="LightboxContainer" data-fetch-url="{xen:link xengallery/fetch, $media}" data-total-count="{$containerCount}">
                    <a href="{xen:link xengallery/preview, $media}" class="mfp-iframe rel="nofollow" Lightbox JsOnly button smallButton toolButton Tooltip" title="{xen:phrase xengallery_view_media_in_lightbox}" data-type="image" data-media-title="{$media.media_title}" data-media-url="{xen:link xengallery, $media}" data-username="{$media.username}" data-user-url="{xen:link 'xengallery/users', $media}"><span></span><i class="fa fa-picture-o fa-lg"></i></a>
                </span>
            </xen:if>
 
Thank you for reporting this issue. It has now been resolved and we are aiming to include it in a future XFMG release (1.1.18).

Change log:
Add nofollow to a few links to prevent duplicate content SEO issues.
Any changes made as a result of this issue being resolved may not be rolled out here until later.
 
Top Bottom