Basically in SPO, default.aspx are discontinued however while migration default pages also get migrated. Here this piece of code finding default pages as it may set up Homepage of sites.

Here, we are finding those default pages across site and subsites and approving it along with the particular user who created or modified.


Moderation Status is a 4-byte integer indicating the moderation approval status of a list item.

Configurations can require moderation approval to publish a list item or allow automatic approval. A published list item MUST have a Moderation Status of 0. The following are all possible valid values for Moderation Status.