Remove unwanted HTML tags from SharePoint

This SharePoint customization tutorial explains, how to remove unwanted HTML tags from SharePoint.

In real-time, we see unwanted HTML tags in SharePoint Web pages. These get displayed when we open a SharePoint view item or in form display lookup values with special characters.

<a onlink=”OpenpopupPage….>Value </a> while opening the view of an item in the SharePoint, where the items are from look up list.

Remove unwanted HTML tags from SharePoint

If you see the form and the items displayed as above, add disable-output-escaping=”yes” as below using SharePoint designer.

Remove unwanted HTML tags from SharePoint 2013

After adding this property in xsl tag, the view item will be :

Remove unwanted HTML tags from SharePoint online

In General XSL

<xsl:value-of select="expression" disable-output-escaping="yes|no" />

XSLT <xsl:value-of> Element: which extracts the value of a selected node and can be used to select the value of an XML element & add it to the output.

Attributes:

  1. select=”expression” :
    This is required.
    An XPath expression that specifies which node/attribute to extract the value from. It works like navigating a file system where a forward slash (/) selects subdirectories.
  2. disable-output-escaping=”yes|no”
    Optional. Default is “no”.
    “yes” indicates that special characters (like “<“) should be output as is.
    “no” indicates that special characters (like “<“) should be output as “<“.

You may like following SharePoint customization tutorials:

Here we learned how to solve remove unwanted HTML tags from SharePoint 2013.

Donwload Hub site pdf

Download SharePoint Online Tutorial PDF FREE!

Get update on Webinars, video tutorials, training courses etc.

>