Hi @Mohammad Qasim ,
Quote from Microsoft:
“Modern pages can only use modern web parts and classic pages can only use classic web parts.”
Since web part pages are classic experiences, when we open the page it will show in classic mode by default.
If you want to open web part page in Modern Layout, we could transform web part page from classic mode to modern via using PnP PowerShell in SharePoint Online Management Shell.
Use the below PowerShell to transform classic pages to modern pages:
Connect to the site:
Connect-PnPOnline -Url https://YourSiteURL
Modernize page. aspx:
ConvertTo-PnPClientSidePage -Identity WebpartPageName.aspx
There are a few things to notice:
1.Web parts on the Classic page are replaced with modern 1st party web parts.
2.Web parts not supported in the Modern SharePoint are not migrated.
Then you will see Migrated_WebpartPage. aspx is created and they are in modern mode.
Classic and Modern experiences reference:
Transform PnP PowerShell and its parameter introduction:
If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.