Skip Navigation

[Resolved] can not delete layout

This support ticket is created 5 years, 4 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 3 replies, has 2 voices.

Last updated by Waqar 5 years, 4 months ago.

Assisted by: Waqar.

Author
Posts
#1317583
delete layout.jpg

I want to delete layout that was assigned to the post, but the post was deleted and now it is not possible to delete the layout.

What is the link to your site?
hidden link

#1317613

Hi Sylvia,

Thank you for contacting us and I'd be happy to assist.

As you noted from the other ticket, this issue has been highlighted and currently, it is only possible to delete such a layout through direct database editing:
https://toolset.com/errata/layouts-cannot-be-unassigned-from-archives-if-the-related-post-types-are-deleted/

If you'd like us to remove that layout for you from the database, you can share a clone/snapshot of your website and we'll make the change and share back the updated clone/snapshot.

Here is a guide on how to share a website's clone/snapshot:
https://toolset.com/faq/provide-supporters-copy-site/

Note: If you're comfortable working with a database import/export through a tool like "phpMyAdmin", you can also alternatively share only the database's export file in "SQL" format.
( ref: hidden link )

Your next reply will be private so that you can share the database or the website's clone, privately.

regards,
Waqar

#1319105

Hi Sylvia,

Thank you for sharing the duplicator package and I was able to deploy it successfully on my server.

I'll need to perform some troubleshooting and will share the next steps on how to remove this unused layout, accordingly.

Thank you for your patience.

regards,
Waqar

#1320103

Hi Sylvia,

Thank you for waiting.

To manually delete the unused layout(s) through the database, here are the steps:

Important note: before proceeding, please make a complete backup copy of the website.

1. Install and activate the plugin "WP phpMyAdmin".
https://wordpress.org/plugins/wp-phpmyadmin-extension/

2. From the plugin's settings page ( hidden link ) use the "Enter phpMyAdmin" button to launch the phpMyAdmin interface.
( screenshot: hidden link )

3. From the list of available tables, switch to the "wp_postmeta" table.
Note: "wp" table prefix part can vary on your website's install.
( screenshot: hidden link )

4. From within the "wp_postmeta" table, click the "edit inline" link and add the query to show only entries for the layout ID that needs to be deleted.
( in this case, I'll be using the ID 9714 for the layout "doesnot work // delete" layout )


SELECT * FROM `wp_postmeta` WHERE post_id = 9714

( screenshot: hidden link )

5. It will show all the meta entries for that layout and you can delete them all.
( screenshot: hidden link )

As a result, that layout will no longer show in the layouts list.

Optionally, you can also delete the post with that same ID (9714) from the "wp_posts" table.
( screenshot: hidden link )


SELECT * FROM `wp_posts` WHERE ID = 9714

I hope this helps and please let me know if you need any further assistance around this.

regards,
Waqar