Piwigo / piwigo-bootstrap-darkroom

A mobile-ready and feature-rich theme for Piwigo photo gallery, based on Bootstrap 4
Apache License 2.0
83 stars 40 forks source link

robots noindex,nofollow set if Metadata is enabled #64

Closed obetz closed 7 years ago

obetz commented 7 years ago

enabling EXIF metadata always sets meta name="robots" content="noindex,nofollow"

Likely caused in image.php if ( $metadata_showable and pwg_get_session_var('show_metadata') ) although I don't know why pwg_get_session_var('show_metadata') should be set.

obetz commented 7 years ago

Found it: themeconf.inc.php line 26: pwg_set_session_var('show_metadata', true);

This way, pages made with Bootstrap Darkroom will not be indexed by search engines, correct?

tkuther commented 7 years ago

Yeah, but showing metadata by default shouldn't disable indexing. This is a core issue, imho.

obetz commented 7 years ago

I agree. Probably the intention was to avoid another indexing if the search engine follows the "show exif" link.

tkuther commented 7 years ago

I think so, but it's a bit messy to have it in the session and bound to a button link.

There should be a global option to show it always, never, for authenticated only. Get rid of the button. Easy.

Currently there is only a config.inc.php option to set the session var to true and the rest of the noindex logic still fires, which is a bug imho. Setting it to true should reverse the logic (noindex, nofollow if it's false, i.e. following the link to hide metadata). Too complex, too messy.

See also https://github.com/tkuther/piwigo-bootstrap-darkroom/wiki/Hide-image-metadata-by-default