The classic Content Editor Web Part, rebuilt for modern SharePoint.
Modern CEWP replicates the classic SharePoint Content Editor Web Part: link to an HTML file containing your HTML and JavaScript, or paste code directly into the page. Free to download and use under the MIT license.
What it does
- Content link — point the web part at an HTML file and it renders on the page, exactly like the classic CEWP.
- Inline HTML — or skip the file and paste HTML and JavaScript straight into the web part.
- CSP-compatible — reworked for the Content Security Policy Microsoft began enforcing on 1 March 2026. How it works →
- Title property — label each instance with what its code does, so a page carrying several web parts stays maintainable.
Working under the new CSP policy
Updated 27 February 2026, ahead of Microsoft’s 1 March 2026 enforcement date.
Content Security Policy blocks the inline script execution the classic web part relied on. Modern CEWP works within it: it reads the HTML you supply — whether loaded through the Content link or entered in the HTML code section — and extracts the script tags before rendering.
- External scripts are loaded by creating script tags and adding them to the page DOM.
- Inline scripts are executed using the
Functionconstructor, which complies with the CSP rules.
Loading external scripts from outside the current site collection requires the script source to be whitelisted in your tenant, under trusted script locations. Scripts hosted within the same site collection need no allow-listing.
Download
Compiled package
Current release v1.0.0.6 — ready to upload to your app catalog.
Source
Full source, issues, and release history. MIT licensed — free to download, use, and modify.
Upgrading from an older version?
Read the “Important Upgrade Notice.md” file included in the download before you deploy — it covers the steps needed when moving up from a pre-CSP build.
Need more than a web part?
Modern CEWP is a free standalone tool. For full form customization on SharePoint — a drag-and-drop builder, rules, and a complete field toolkit — see Modern DFFS.