Title: Additional SQL queries to remove orphaned table columns
Last modified: April 10, 2024

---

# Additional SQL queries to remove orphaned table columns

 *  Resolved [bclaim](https://wordpress.org/support/users/bclaim/)
 * (@bclaim)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/additional-sql-queries-to-remove-orphaned-table-columns/)
 * Hello,
 * I was reading this article: [https://www.paidmembershipspro.com/pmpro-update-3-0/](https://www.paidmembershipspro.com/pmpro-update-3-0/)
   and came across this section “You can optionally run these additional SQL queries
   to remove orphaned table columns in the pmpro_membership_orders table or orphaned
   usermeta (for sites that were using the Stripe Billing Limits Add On).”. It links
   to this: [https://gist.github.com/kimcoleman/e930d330a4be2938ac2b5058e1b217f9](https://gist.github.com/kimcoleman/e930d330a4be2938ac2b5058e1b217f9)
 * Can you explain the steps needed to “run” these queries? Appreciate your help!
 * Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Support [Jarryd Long](https://wordpress.org/support/users/jarryd-long/)
 * (@jarryd-long)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/additional-sql-queries-to-remove-orphaned-table-columns/#post-17587207)
 * Hi there, thank you for reaching out to Paid Memberships Pro.
 * You can add this to your theme’s functions.php file or PMPro Customizations plugin
   file and visit the /wp-admin dashboard.
 * As this runs on admin init, every time you visit the admin dashboard the script
   will run – I would recommend disabling it after a couple of visits.
 * Kind Regards,
   Jarryd_Support Manager at Paid Memberships Pro_
 *  Thread Starter [bclaim](https://wordpress.org/support/users/bclaim/)
 * (@bclaim)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/additional-sql-queries-to-remove-orphaned-table-columns/#post-17591509)
 * Okay, thank you. I will try the theme’s functions.php method.
 *  Plugin Support [Jarryd Long](https://wordpress.org/support/users/jarryd-long/)
 * (@jarryd-long)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/additional-sql-queries-to-remove-orphaned-table-columns/#post-17678804)
 * My pleasure. Feel free to reach out if there’s anything else we can assist with.
 * Kind Regards,
   Jarryd_Support Manager at Paid Memberships Pro_

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Additional SQL queries to remove orphaned table columns’ is closed to
new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/paid-memberships-pro_f1dacb.svg)
 * [Paid Memberships Pro - Content Restriction, User Registration, & Paid Subscriptions](https://wordpress.org/plugins/paid-memberships-pro/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/paid-memberships-pro/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/paid-memberships-pro/)
 * [Active Topics](https://wordpress.org/support/plugin/paid-memberships-pro/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/paid-memberships-pro/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/paid-memberships-pro/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Jarryd Long](https://wordpress.org/support/users/jarryd-long/)
 * Last activity: [2 years, 2 months ago](https://wordpress.org/support/topic/additional-sql-queries-to-remove-orphaned-table-columns/#post-17678804)
 * Status: resolved