"noindex" for nearly all pages
Posted: Tue Jul 31, 2018 1:50 am
This is the problem from the german subforum: viewtopic.php?f=10&p=10450914&sid=a202a ... #p10450914 and i was able to hack it. Because I don't know if what I've done is right and I think this is a bug to fix, I repost it here.
Basically, all my pages in my blog weren't indexed by Google because of the "noindex" header. Only the static pages are indexed. I followed the problem through the source and one piece of the problem are the these lines in the index.tpl (I use the 2k11 theme):
That means that either the $view is not one of possibilies for index and/or $view is not defined at all. The latter could be true, because in the transfer between the $serendipity[] array to the $serenditipy['smarty']->assign (functions_smarty.inc.php on line 1062) the parameter 'view' is missing:
After inserting there the line
the start page changed to 'index,follow'. But not the entries linked on the start page. Because one of the values for 'view' is 'archives' and looked attractive i tried to add '|| $view == "archives" ' in the index.tpl (2k11) line 12:
and then all the full entries changed to 'index,follow' too. Now I could init a new crawling by Google and hopefully, all the 132 skipped pages are now going to be indexed.
I don't know what the origin of this bug is - I simply cannot be true that all pages powered by s9y since forever weren't ever indexed by Google - but I think it important to fix asap.
For the plugins, I only use serendipity_event_multilingual and I don't think that this one is guilty ...
Basically, all my pages in my blog weren't indexed by Google because of the "noindex" header. Only the static pages are indexed. I followed the problem through the source and one piece of the problem are the these lines in the index.tpl (I use the 2k11 theme):
Code: Select all
{if ($view == "entry" || $view == "start" || $view == "feed" || $view == "plugin" || $staticpage_pagetitle != "" || $robots_index == 'index')}
<meta name="robots" content="index,follow">
{else}
<meta name="robots" content="noindex,follow">
{/if}
Code: Select all
function serendipity_smarty_init($vars = array()) {
...
$serendipity['smarty']->assign(
array(
'head_charset' => LANG_CHARSET,
'head_version' => $serendipity['version'],
'head_title' => $serendipity['head_title'],
'head_subtitle' => $serendipity['head_subtitle'],
'head_link_stylesheet' => $serendipity['smarty_vars']['head_link_stylesheet'],
'head_link_script' => $serendipity['smarty_vars']['head_link_script'],
'head_link_stylesheet_frontend' => $serendipity['smarty_vars']['head_link_stylesheet_frontend'],
'is_xhtml' => true,
'use_popups' => $serendipity['enablePopup'],
'use_backendpopups' => $serendipity['enableBackendPopup'],
'force_backendpopups' => $force_backendpopups,
'is_embedded' => (!$serendipity['embed'] || $serendipity['embed'] === 'false' || $serendipity['embed'] === false) ? false : true,
'is_raw_mode' => $serendipity['smarty_raw_mode'],
'is_logged_in' => serendipity_userLoggedIn(),
'entry_id' => (isset($serendipity['GET']['id']) && is_numeric($serendipity['GET']['id'])) ? $serendipity['GET']['id'] : false,
'is_single_entry' => (isset($serendipity['GET']['id']) && is_numeric($serendipity['GET']['id'])),
'blogTitle' => $serendipity['blogTitle'],
'blogSubTitle' => (!empty($serendipity['blogSubTitle']) ? $serendipity['blogSubTitle'] : ''),
'blogDescription' => $serendipity['blogDescription'],
'serendipityHTTPPath' => $serendipity['serendipityHTTPPath'],
'serendipityDefaultBaseURL' => $serendipity['defaultBaseURL'],
'serendipityBaseURL' => $serendipity['baseURL'],
'serendipityRewritePrefix' => $serendipity['rewrite'] == 'none' ? $serendipity['indexFile'] . '?/' : '',
'serendipityIndexFile' => $serendipity['indexFile'],
'serendipityVersion' => ($serendipity['expose_s9y'] ? $serendipity['version'] : ''),
'view' => $serendipity['view'],
'lang' => $serendipity['lang'],
'category' => $category,
'category_info' => $category_info,
'template' => $serendipity['template'],
'template_backend' => $serendipity['template_backend'],
'wysiwygToolbar' => $serendipity['wysiwygToolbar'],
'wysiwyg_customPlugin' => $wysiwyg_customPlugin,
'wysiwyg_customConfig' => $wysiwyg_customConfig,
'use_autosave' => (serendipity_db_bool($serendipity['use_autosave']) ? 'true' : 'false'),
'dateRange' => (!empty($serendipity['range']) ? $serendipity['range'] : array())
)
);
After inserting there the line
Code: Select all
'view' => $serendipity['view'],
Code: Select all
{if ($view == "entry" || $view == "start" || $view == "archives" || $view == "feed" || $view == "plugin" || $staticpage_pagetitle != "" || $robots_index == 'index')}
<meta name="robots" content="index,follow">
{else}
<meta name="robots" content="noindex,follow">
{/if}
I don't know what the origin of this bug is - I simply cannot be true that all pages powered by s9y since forever weren't ever indexed by Google - but I think it important to fix asap.
For the plugins, I only use serendipity_event_multilingual and I don't think that this one is guilty ...