When we add a lookup column to any SharePoint list, it appears with the link to the parent item in SharePoint list views. Quite often, the end-user clicks on the lookup link and edits the parent lookup item by mistake – People get confused about which link to click. So we wanted to remove hyperlinks from lookup columns in SharePoint 2013 list views.
SharePoint 2013 remove hyperlink from lookup column – No code solution:
Here is how you can remove hyperlink from lookup fields out-of-the-box without any coding and customization efforts.
- Go to your list settings, pick the lookup column. In my case, it’s “Parent Project”. On the “Edit Column” page, select the “Title” field under the “Add a column to show each of these additional fields” Section as highlighted below.
- Now, edit your list view, unselect the “Parent Project” field, and select the “Parent Project: Title” field. (You can rename this Title – BTW!)
- Click “OK” to save the view. That’s all! This removes the link from hyperlink columns.
However, in Display form of the list, it still shows link in hyperlink fields, isn’t it? Proceed with the below method to remove hyperlink from lookup column. Although lookup field links can be removed using SharePoint designer-XSLT methods, I prefer this jQuery as its relatively simpler.
Using jQuery to remove hyperlink from lookup column:
Lookup columns are pointing to. link something like “http://Site/***&RootFolder=*”. So, let’s find all Anchor elements of the page with HREF attributes
“&RootFolder=*”. and remove the link of the lookup.
To remove lookup hyperlink from SharePoint list view using jQuery, follow these steps:
- Go to your List view page, E.g. http://portal.crescent.com/Lists/ProjectMilestones/AllItems.aspx
- Click on Site Settings gear, click on the “Edit Page” menu item
- Click on Add a Web Part link shown on the page, Under “Media and Content” choose “Script Editor” and click on the “Add” Button
- Click on the “Edit Snippet” link on the Script Editor Web part and place the below code in it and save the page.