How to create a redirect page using a SharePoint news link
A redirect web page is a technique used to automatically send a website user from one URL to another URL. In SharePoint this process can be achieved at site collection level with a site swap as explained in here, or temporarily using a SharePoint news link.
A SharePoint News link is a hyperlink that points to a news article or post on a SharePoint site or available globally in the web, however it can be also used as a redirect page.
The problem using this approach is that the redirect page will show in the SharePoint news web part and everywhere else where SharePoint news are displayed! To prevent this side effect, you should to the following:
- From the home page of the site where you want to implement the URL click in New
- From the menu click in News link
- Type the URL of the page to where the user should be redirected
- Click Post
- Click in the cog icon in the suite bar and then Site Contents
- Open the Site Pages library
- Locate the page you have just created, click in the … next to the name and then click in Make homepage
This will make the home page of the site collection redirect to the new location, if you don’t want it to show in the news you will need to execute the following script using PnP PowerShell.
In order to accomplish the steps described in this article you must install the latest version of the PnP PowerShell module, more information about how to do it can be found here.
- Open the PowerShell command line
- Execute the following cmdlet to connect to the SharePoint site collection where the redirect page was created
Connect-PnPOnline -url https://contoso.sharepoint.com
- Execute the script below and update the $listItemID value and use your own
$listItemID = 42 Set-PnPListItem -List "SitePages" -Identity $listItemID -Values @{ "PromotedState"=0; }
By executing this script your news link redirect page will be removed from the SharePoint news without losing its main purpose.
February 20, 2023
I didnt understand why my sharepoint site was redirecting ! To stop it, instead of using a script as you shared, which can be complicate for non tech savy, i navigated to the site content
https://xxxxx.sharepoint.com/sites/xxx/_layouts/15/viewlsts.aspx
Thank you for the tip to create redirection
February 25, 2023
Thanks for sharing your feedback Jeff
November 6, 2023
I’m trying to stop the redirect also but this navigation method is not working. it says “404 file not found” and the script method is not for me. help please.
November 6, 2023
Update: I got there (there was a typo on my end), but how do I remove the news link and get back to where I started?
November 15, 2023
Hi Jeremy,
Go to the SitePages library and remove the news link or set another page as the home for the site.