SOLVED

Change News Page to Site Page

Deleted
Not applicable

Hi All,

 

I'm looking for a method of changing a News Page to a Site Page.  These pages were created prior to the hub sites being rolled out, now they are showing up in the News sections of all pages.

 

I'm familiar with the Promoted State column, but I haven't been able to find instructions on how to actually change the value in that column.  I've seen references to using Flow but never any instructions on actually doing that.

 

Any tips on this would be appreciated.

60 Replies

There is a SPFx extension created by Mikael Svenson for demoting news pages. You can use this extension for your requirements.

Sample code at: Demote News to page Command 

 

preview


Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

Thank you so much for this solution. Worked well for me. One question left, just to be shure, is it after i've change the state from "2" to "0", necessary to rename the column back to "Promoted state"? Or is it ok to keep this at "All Items and State"?

You are awesome. Your workaround works perfectly! Thank you!

I dont't get this Quick Edit option, only "Edit in grid view" and then it says the cell for Promoted State is read only, so I can't change it. Any ideas on what I should do?

@carlosxjunior you can see my post on how to change the promoted state at https://techcommunity.microsoft.com/t5/sharepoint/sharepoint-news-post-still-appears-even-after-the-...

 

Rob
Los Gallardos
Intranet, SharePoint and Power Platform Manager (and classic 1967 Morris Traveller driver)

If this worked in April 2022, I'm afraid Microsoft have closed that loophole now too. They really don't want us messing with this field - which remains read-only. But still we appear to have no "Demote" option available as standard... so still we scratch our heads over what to do about mistakenly promoted pages... I'm afraid my Admin blocks the use of SPFx extensions like the one mentioned above - but hopefully that option is still available (and still works) for some of you.

@brewsa @carlosxjunior You can also use SharePoint JSON formatting to demote news pages in SharePoint.

 

Check the column formatting sample for same: Demote News to Site Page screenshot.gif


Please consider giving a Like if my post helped you in any way.

Many thanks for the tip - I will give it a try. Where would we be without @thechriskent!

Hello,

 

Have there been any recent developments in this? I setup my page as indicated in the solution here but the column is now greyed out and says it is a read-only field. 

 

Thank you,

Nicole

The column formatting solution above from @thechriskent (posted above by @ganeshsanap) worked for me in a few seconds.

@npajak22 Try solution given in my above response using SharePoint JSON formatting. Let us know if it works for you.


Please consider giving a Like if my post helped you in any way.

@ganeshsanap you are amazing for sharing this - thank you so much

 

Start Here:

  • Site Contents 
  • Site Pages 
  • Change View Option to All Pages

Turn on the Promoted State Column: 

  • Add this column by selecting + sign next to the last column displayed in the header
  • Then select Show/hide columns
  • Scroll down to Promoted State and check the box and click Apply

Add JSON:

  • Go into edit in grid view
  • Click promoted state column arrow - column settings - format this column 
  • Apply formatting to - select Promoted State 
  • Delete code that is there and paste this code found in link below into it
  • Save - refresh page 
  • Click ellipsis - Demote (Change to 0:Page) 

Finish It:

  • THEN GO TO THE PAGE AND REPUBLISH IT TO TAKE AFFECT

https://github.com/pnp/List-Formatting/blob/master/column-samples/promotedstate-demote-news/promoted... 

 

https://github.com/pnp/List-Formatting/tree/master/column-samples/promotedstate-demote-news 

@c00p82 Thank you for your reply. I am able to follow the instructions up until the Add JSON: step. Then I don't understand how to add the script to the page. Do you have any pointers? 

@npajak22  - on the right - the view option defaults to By Author - click on that and change to All Pages - once that happens on the left Edit in grid view will show up

@c00p82 This is the error I'm getting when I copy/paste the script into a snippet - is this what I'm supposed to do? 

 

"Uncaught SyntaxError: Unexpected token ':' (at demote:2:12)"

Yes, I can get to edit in grid view no problem.
Ohhhhhhh - I got it now. Thank you!!!!

I tried this by when I try to change 2 to 0, it says cell is "read only"... I am a site owner.   Any suggestions?

I have been using this JSON for months now and it was working great. But now, even though the promoted state says 0 and we have unpublished the page, the pages are still showing up in the news webpart. It seems that the only way for us to get them to go away is to delete them.
Does anyone have any suggestions?
You can use PnP PowerShell to do this by changing the PromotedState field from 2 to 0

#change to your site address
$SiteURL = "https://crescent.sharepoint.com/sites/Intranet"

#Connect to Site
Connect-PnPOnline $SiteURL -Interactive # to use web creds, replace with 'Connect-PnPOnline -Url $SiteURL -UseWebLogin'

#Get all Site pages - along with their IDs
Get-PnPListItem -List "SitePages"

#Demote News page with ID "4" to Site Page
Set-PnPListItem -List "SitePages" -Identity 4 -Values @{"PromotedState"="0"}

For reference, see https://www.sharepointdiary.com/2020/03/promote-site-page-to-news-page-in-sharepoint-online.html