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

    Details

    • Testing Instructions:
      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).
    • Affected Branches:
      MOODLE_34_STABLE
    • Fixed Branches:
      MOODLE_34_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-57734-master

      Description

      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

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  13/Nov/17