Remove the Ability to Add JavaScript in the Control Panel's Site Pages
How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!
While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.
Legacy Article
You are viewing an article from our legacy "FastTrack"
publication program, made available for informational purposes. Articles
in this program were published without a requirement for independent
editing or verification and are provided"as is" without
guarantee.
Before using any information from this article, independently verify its
suitability for your situation and project.
Issue
- Disable the ability to add JavaScript to pages on DXP 7.0 and thus prevent malicious code injections.

Environment
- DXP 7.0 Fix Pack 60+
- This functionality was introduced in DXP 7.0 Fix Pack 60
Resolution
- Install DXP 7.0 Fix Pack 60 or higher.
-
In the portal-ext.properties, add the following properties -
-
field.enable.com.liferay.portal.kernel.model.Layout.javascript=false
-
field.enable.com.liferay.portal.kernel.model.LayoutSet.javascript=false
- Start the application server.
-
Navigate to the Configure Page menu by clicking Control Panel > Navigation > 3-dot icon > Configure Page next to any page (public or private).
At this point, the ability to add JavaScript is no longer available.

Did this article resolve your issue ?