Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-57734

SEO - Create admin setting to be able to enable or disable search engine indexing for sites with forcelogin

XMLWordPrintable

    • MOODLE_34_STABLE
    • MOODLE_34_STABLE
    • MDL-57734-master
    • Hide

      Go to Site Administration > Security > Site Policies.
      Find setting "Allow indexing by search engines".
      Ensure that each option is applied correctly when set (by inspecting source and looking for the "noindex" robots meta tag in the appropriate pages).

      Show
      Go to Site Administration > Security > Site Policies. Find setting "Allow indexing by search engines". Ensure that each option is applied correctly when set (by inspecting source and looking for the "noindex" robots meta tag in the appropriate pages).

      Hi there,

      we changed our Moodle site to only get access with a forced login ($CFG->forcelogin = true).
      A student wondered why our Moodle is not listed in search engines. He did not remember the URL and wanted to find the login page with the search engine.

      Then I saw that the meta tag <meta name="robots" content="no-index"> is placed in the header although I did not enter this in the setting additionalhtmlhead or even if I entered <meta name="robots" content="index"> it.

      So, I had a look a the code and realised that the meta tag is added hardcoded in this files:

      ./login/signup.php:$CFG->additionalhtmlhead .= '<meta name="robots" content="noindex" />';
      ./login/index.php:$CFG->additionalhtmlhead .= '<meta name="robots" content="noindex" />';
      

      login/index.php line 30

      // Try to prevent searching for sites that allow sign-up.
      if (!isset($CFG->additionalhtmlhead)) {
          $CFG->additionalhtmlhead = '';
      }
      $CFG->additionalhtmlhead .= '<meta name="robots" content="noindex" />';
      

      Although we use the forcelogin we would like to have our root URL listed in search engines.

      So it would be great if you could add an admin setting for this (e.g. on /admin/settings.php?section=sitepolicies) so that admins can decide if they want their forelogin-Moodle-instance to be indexed by search engines or not.

      Thanks and cheers, Kathrin

            yairspielmann Yair Spielmann
            kosswa Kathrin Osswald
            John Okely John Okely
            David Monllaó David Monllaó
            David Mudrák (@mudrd8mz) David Mudrák (@mudrd8mz)
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.