Skip to main content
ppppppppgonzaga
Inspiring
November 4, 2025
Answered

Clear/Delete/Override section numbering in a document made from a converted PDF

  • November 4, 2025
  • 2 replies
  • 1632 views

Hi again! 🙂

 

I just converted a PDF into an indesign file, but I noticed it came with a bunch of section breaks —  the page numbering restarts every 1, 2 or 3 pages. I've selected all pages and tried to override the sections by starting a whole new section in "numbering and section options" but it just affected the first section/the first two pages.

 

By any chance, does anyone know a good workaround so that it won't be necessary to manually reset all the sections one by one, not in this nor in future converted documents, please? 

Correct answer Mike Witherell

This JavaScript will successfully remove extra section markers:

/**
 * Remove all section numbering and section markers
 * except for the first page in the active InDesign document.
 * Works in InDesign 2026.
 */

(function () {
    if (app.documents.length === 0) {
        alert("Please open a document first.");
        return;
    }

    var doc = app.activeDocument;
    var sections = doc.sections;

    if (sections.length === 0) {
        alert("No sections found in this document.");
        return;
    }

    // Keep only the first section; remove all others
    for (var i = sections.length - 1; i >= 1; i--) {
        try {
            sections[i].remove();
        } catch (e) {
            $.writeln("Error removing section: " + e);
        }
    }

    // Reset the first section’s properties to make sure it’s clean and intact
    var firstSection = sections[0];
    firstSection.continueNumbering = false;
    firstSection.pageNumberStart = 1;
    firstSection.sectionPrefix = "";
    firstSection.marker = "";
    firstSection.includeSectionPrefix = false;

    alert("All section numbering and markers removed except on the first page. And Mike says hello.");
})();

2 replies

Community Expert
November 5, 2025

Just for future reference, by default whenever you open the Numbering and Section Options dialog box (Layout>Numbering and Sections Options... menu command), you may find that it automatically creates a new section on whatever page is selected in the Pages panel.

 

If it's the first page in the document, the Start Section check box is grayed out. But on any other page in the document, that Start Section check box will be live and it will be checked. Whether you want to start a new section or not. So the last thing you want to do before you leave that dialog box is make sure that the Start Section check box is unchecked before you exit the dialog box. Or you may end up with that new section and restarting your page numbering, again, whether you want it or not.

 

Hope this helps,

 

Randy

Mike Witherell
Community Expert
Mike WitherellCommunity ExpertCorrect answer
Community Expert
November 4, 2025

This JavaScript will successfully remove extra section markers:

/**
 * Remove all section numbering and section markers
 * except for the first page in the active InDesign document.
 * Works in InDesign 2026.
 */

(function () {
    if (app.documents.length === 0) {
        alert("Please open a document first.");
        return;
    }

    var doc = app.activeDocument;
    var sections = doc.sections;

    if (sections.length === 0) {
        alert("No sections found in this document.");
        return;
    }

    // Keep only the first section; remove all others
    for (var i = sections.length - 1; i >= 1; i--) {
        try {
            sections[i].remove();
        } catch (e) {
            $.writeln("Error removing section: " + e);
        }
    }

    // Reset the first section’s properties to make sure it’s clean and intact
    var firstSection = sections[0];
    firstSection.continueNumbering = false;
    firstSection.pageNumberStart = 1;
    firstSection.sectionPrefix = "";
    firstSection.marker = "";
    firstSection.includeSectionPrefix = false;

    alert("All section numbering and markers removed except on the first page. And Mike says hello.");
})();
Mike Witherell
ppppppppgonzaga
Inspiring
November 4, 2025

Hello Mike! Works perfectly! 

Thank you so much!

 

 

Mike Witherell
Community Expert
Community Expert
November 5, 2025

You are welcome!

Mike Witherell