Replace CE / SE Web Part Content PS1

Managing front end code (HTML/JS) embedded within Script and Content Editor Web Parts can be a hassle.   With multiple instances scattered across ASPX pages, web part galleries, and many sites quickly becomes untenable.

The below PowerShell script gives SharePoint admins a new way to search/replace the internal text of CEWP/SEWP web parts within a target site collection.    Updating a URL reference or DNS name can now be done across potentially hundreds  of WP in just a few minutes.

For example, a team site having 1 CEWP and 1 SEWP with the world “hello” can be quickly replaced with “hola” by running this script.

Cheers!  shades_smile


Source Code


Screenshot – Before





Screenshot – After






Return to Top ▲Return to Top ▲