Removing Paginated URLs From jekyll-sitemap

65 views Asked by At

How to Remove Paginated URLs From Jekyll-sitemap ⬇ example sitemap file content

pagination:
  enabled: true
  per_page: 6
  offset: 0
  permalink: "/page/:num/"
  title: ":title - page :num of :max"
  limit: 0
  sort_field: date
  sort_reverse: true

I am using pagination v2,

I tried

paginate_path: "/blog/page/:num/"

defaults:
- scope:
    path: "blog/page"
  values:
    sitemap: false

and

paginate_path: "/blog/:num/"
defaults:
- scope:
    path: "blog"
  values:
    sitemap: false

etc.

1

There are 1 answers

0
devlopersfield On

As I tried all possible solutions getting from research but nothing works in my case so I suggest adding

sitemap: false

in the front matter of your

/blog/

page, this will remove all the pages generated by the paginator but this will also remove /blog/ URL so, for this, you have to make a new .md file with only

permalink: "/blog/"

and redirect this link to your main blog page such as

enter image description here

it may help you