skip to Main Content

A quick question about sitemap. Is it possible to regenerate the sitemap? I want to remove tag and author pages from sitemap for SEO purpose. There’s a another way to disabled tags and author to remove from routes.yml which means 404 pages so that would be bad impact on SEO.

2

Answers


  1. Update:

    Rather than removing authors and tags entirely you can generate a custom sitemap using routes.yaml and a custom template. The official Ghost docs shows how to create a sitemap for Google News, which can also be applied for a custom XML Sitemap: https://ghost.org/docs/tutorials/create-a-google-news-sitemap/


    You’ll need to remove them from the routes.yaml file. The default is:

    taxonomies:
      tag: /tag/{slug}/
      author: /author/{slug}/
    

    Removing these lines will remove the author and tag pages from the sitemap and from the site entirely.

    You’ll also need to update your theme to not link to these pages, to prevent 404 errors from appearing.

    Login or Signup to reply.
  2. In order to remove the tags and authors pages from the sitemap, you have edit the file /current/core/frontend/services/sitemap/manager.js of your Ghost installation.

    In that file, you will have to modify the createIndexGenerator() method, removing the lines related to tags and authors. After modifying it, the method will look like the following:

    createIndexGenerator() {
      return new IndexMapGenerator({
        types: {
          pages: this.pages,
          posts: this.posts
        }
      });
    }
    

    And you are done!

    Please, take into account that file modified belongs to the Ghost core, so it will be overwritten when updating Ghost.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search