When working on Liferay DXP a few years back, our team was stuck with an issue where a portlet that got deployed, could not be deleted from the UI, because of unavailability of “Remove”.

bad-portlet-2

If you have been stuck with something similar in past, there is a quick workaround I found, that served the purpose. Though, I believe, there could be a better way to handle this, but with limited knowledge of the platform, I came up with the solution as below. I understand that the same method can also be implemented in Liferay 7, which is the free community version.

1. Select some other Portlet’s Option menu

bad-portlet-3

Go to some other portlet’s options and hover your mouse on the remove Option of that portlet. Right Click on the Remove option here and copy the URL from here.

2. Analyze the URL and find Locate Portlet ID

From the captured URL, find the portlet ID in the URL. This is the unique ID of the portlet that you want to delete. It would look something as below:

http://myliferayportal.cloudapp.net:8080/c/portal/update_layout?p_auth=fT4rnfmn&p_l_id=213419&p_p_id=MY_LIFERAY_PORTLET_ID&p_v_l_s_g_id=20182&cmd=delete&referer=%2Fc%2Fportal%2Flayout%3Fp_l_id%3D213419&refresh=1

3. Replace your Portlet’s ID and Open the URL

As you now have a URL to remove a portlet, you just need to replace the p_p_id parameter of the URL with the one for the portlet instance that you are trying to remove but cannot.

Once you open this new URL in browser, your bad portlet will be deleted and no more visible in the UI.

I hope this small tip proves to be useful for people out there who face similar issue with their Liferay DXP development.

Pin It on Pinterest