Generating blank pages

Hello,
I have disabled posts on the main page of the site.
They are not displayed.
I commented this code block:

    {{#foreach posts visibility="all"}}

        {{!-- The tag below includes the markup for each post - partials/post-card.hbs --}}
        {{> "post-card"}}

    {{/foreach}}

Why does Ghost generate pages from my site like this?

domain.com/page/2/
domain.com/page/3/
..

Google is indexing them, but they are empty

I have 29 pages automatically created by the system, but they are empty
from /page/2 to /page/29

Any idea how to solve the problem?

I think you can increase the post_per_page amount from the package.json file.

If I increase this parameter how can I solve?
I disabled the posts from the index, but ghost continues to generate the pages as if they were there. I now have over 30 automatically generated blank pages