Hello/Hi/Greetings,
I have a 'little' problem with the entry:
<meta name="robots" content="noindex,nofollow"> in Piwigo 12.2.0
It causes that my photos not to be scanned by Google.
This entry is created in the picture.php file by the following rule:
if ( $metadata_showable and pwg_get_session_var('show_metadata') )
{
$page['meta_robots']=array('noindex'=>1, 'nofollow'=>1);
}
Trigger is the entry:
pwg_set_session_var('show_metadata', true);
in my theme 'stripped', in the file 'themeconf.inc.php'.
OK, I can modify the php-files - but this is not the right way.
Is it possible to change the entry "noindex,nofollow" by a command in the file "local/config/config.inc.php" so that Google can scan the page?
Or is there another way to solve the problem?
Offline
Hello !
Have you tried the plugin Meta ? There, you can specify values for meta robots. I chose : all.
https://piwigo.org/ext/extension_view.php?eid=220
Offline
Katryne wrote:
Hello !
Have you tried the plugin Meta ?
Hi Katryne,
Sorry, I can't see how I can change a system default setting with "meta".
I myself have used "meta" in the past, but I tend to use as few plugins as possible.
I have my meta data all defined via the my-stripped-header.tpl file.
But now I want to change a default system setting (noindex).
Offline
Noindex, nofollow is a directive for indexing robots.
If you want robots to index your site, you have to modify the directive. This is the way to do it.
I used the plugin meta, modified the meta directive for robots and now for all my site, I can see in source mode :
<meta name="robots" content="all">
See this site: https://dardennes.revestou.fr/
What else would you want ?
I do not do this for all my piwigos, only for the ones I choose to broadcast, others sites are more discreet and altough public, not indexed.
Offline
Thanks for your info. But that does not solve the problem. There are obviously certain combinations with different theme and show Metadata that trigger a "noindex".
See here:
https://piwigo.org/forum/viewtopic.php?id=27119
https://de.piwigo.org/forum/viewtopic.php?id=1383
[Github] Piwigo issue #698
[Github] piwigo-bootstrap-darkroom issue #64
To solve the problem I have in "my_header.tpl" the entry:
{if not empty($head_elements)}
{foreach from=$head_elements item=elt}{$elt}
{/foreach}
{/if}
changed as follows:
{if not empty($head_elements)}
{foreach from=$head_elements item=elt}
{strip}
{if $elt|strstr:"noindex,nofollow"} {continue}{/if}
{$elt}
{/strip}
{/foreach}
{/if}
Thanks to "WuppiGER" ;-)
Offline
Hi,
its a quite old topic.
I stumbled across this thread because goolge search console informed me that my images could not be indexed because of the robots noindex,nofollow tag.
I tried out the solution provided by WuppiGER which solved the problem but leads to a new one.
The solution will make the OSM Map to disappear on the picture page.
It does not make a difference if i use the meta plugin and set robots to "all" or "index,follow". Or add this line in the "Add Head element" plugin:
<meta name="robots" content="index, follow">
The source of the picture pages show alway also the noindex, no follow - which is recognized at least by Googles search bot.
I guess it is because i have set show exif and show iptc in the local files editor which makes the code in picture.php "valid" and noindex, nofollow is added to the picture page.
if ( $metadata_showable and pwg_get_session_var('show_metadata') )
{
$page['meta_robots']=array('noindex'=>1, 'nofollow'=>1);
}
The "dirty hack" would be to comment out line 621 in picture.php:
$page['meta_robots']=array('noindex'=>1, 'nofollow'=>1);
but editing a core file is not the solution i am looking for.
Any ideas for a more elegant solution without the need to re-edit picture.php after the next update?
Cheers
Ralf
Offline
Seems like editing the core file is the only viable option right now.
Wouldn't it make sense to remove the line in the code master for now until a better solution has been found? As it is now, that logic causes massively more harm than good.
Offline
jan-k wrote:
Seems like editing the core file is the only viable option right now.
I've commitet a very small patch with (maybe wrong description) https://github.com/Piwigo/Piwigo/pull/2307
The variable in global settings "$conf['meta_ref']" should be respected im output of picture.php. If there is a "false" "noindex,nofollow" is ther right robots tag. But if it is not false, do not set the wrong header!
I hope, my pull request will be accepted.
Offline