Announcement

#1 2022-06-11 14:31:07

John.B
Member
2016-03-27
46

noindex, nofollow

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

 

#2 2022-06-11 14:56:01

Katryne
Member
2016-12-03
369

Re: noindex, nofollow

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


http://photos.katrynou.fr/ v.14.1.0 https://album.chauvigne.info/ v.13.8.0
Système d'exploitation: Linux - Hébergeur 1&1-Ionos PHP: 8.0.28 - MySQL: 5.7.38
Bibliothèque graphique: External ImageMagick 6.9.10-23

Offline

 

#3 2022-06-11 15:43:11

John.B
Member
2016-03-27
46

Re: noindex, nofollow

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

 

#4 2022-06-11 15:55:12

Katryne
Member
2016-12-03
369

Re: noindex, nofollow

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 :

Code:

<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.


http://photos.katrynou.fr/ v.14.1.0 https://album.chauvigne.info/ v.13.8.0
Système d'exploitation: Linux - Hébergeur 1&1-Ionos PHP: 8.0.28 - MySQL: 5.7.38
Bibliothèque graphique: External ImageMagick 6.9.10-23

Offline

 

#5 2022-06-11 16:48:55

John.B
Member
2016-03-27
46

Re: noindex, nofollow

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

 

#6 2024-02-12 17:33:28

Ralf
Member
Dorsten-Lembeck
2012-05-08
230

Re: noindex, nofollow

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


There are only two kinds of music:
Rock and Roll

https://www.ralf-kerkhoff.de

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact