Legacy Knowledge Base
Published Jul. 2, 2025

List of Special Characters which cannot be used for tagging

Written By

Liferay Support

How To articles are not official guidelines or officially supporteddocumentation. They are community-contributed content and may not alwaysreflect the latest updates to Liferay DXP. We welcome your feedback toimprove How to articles!

While we make every effort to ensure this Knowledge Base is accurate, itmay not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with anyfeedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack"publication program, made available for informational purposes. Articlesin this program were published without a requirement for independentediting or verification and are provided "as is" withoutguarantee.

Before using any information from this article, independently verify itssuitability for your situation and project.

Liferay Support does not recommend or endorse specific third-party products over others. Liferay is not responsible for any instructions herein or referenced regarding these products. Any implementation of these principles is the responsibility of the subscriber.

This article is a legacy article. It applies to previous versions of the Liferay product. While the article is no longer maintained, the information may still be applicable.

While Liferay will allow some special characters like " " (whitespace) or "$" (dollar) in Tags, others like "&" (ampersand) or "*" (askterisk) cannot be used and will result with an error message. "One of your fields contains invalid characters"

Resolution

The reason these special characters aren't allowed is that they may interfere with indexing or queries. Here are the relevant lines of code:

6.0.x Build: com.liferay.portlet.asset.util.AssetUtil.java

public static char[] INVALID_CHARACTERS = new char[] { CharPool.AMPERSAND, CharPool.APOSTROPHE, CharPool.AT, CharPool.BACK_SLASH, CharPool.CLOSE_BRACKET, CharPool.CLOSE_CURLY_BRACE, CharPool.COLON, CharPool.COMMA, CharPool.EQUAL, CharPool.GREATER_THAN, CharPool.FORWARD_SLASH, CharPool.LESS_THAN, CharPool.NEW_LINE, CharPool.OPEN_BRACKET, CharPool.OPEN_CURLY_BRACE, CharPool.PERCENT, CharPool.PIPE, CharPool.PLUS, CharPool.POUND, CharPool.QUESTION, CharPool.QUOTE, CharPool.RETURN, CharPool.SEMICOLON, CharPool.SLASH, CharPool.STAR, CharPool.TILDE };
 
6.1.x Build: com.liferay.portlet.asset.util.AssetUtil.java
 
public static final char[] INVALID_CHARACTERS = new char[] { CharPool.AMPERSAND, CharPool.APOSTROPHE, CharPool.AT, CharPool.BACK_SLASH, CharPool.CLOSE_BRACKET, CharPool.CLOSE_CURLY_BRACE, CharPool.COLON, CharPool.COMMA, CharPool.EQUAL, CharPool.GREATER_THAN, CharPool.FORWARD_SLASH, CharPool.LESS_THAN, CharPool.NEW_LINE, CharPool.OPEN_BRACKET, CharPool.OPEN_CURLY_BRACE, CharPool.PERCENT, CharPool.PIPE, CharPool.PLUS, CharPool.POUND, CharPool.QUESTION, CharPool.QUOTE, CharPool.RETURN, CharPool.SEMICOLON, CharPool.SLASH, CharPool.STAR, CharPool.TILDE }TILDE };
Did this article resolve your issue ?

Legacy Knowledge Base