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