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 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.

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