If you need to switch a large number of subscriptions to use manual renewals, and you are proficient with PHP and/or MySQL, you can also programmatically change a subscription’s payment method to be manual.
Change a Subscription to Manual Payments via Database
↑ Back to topTo change a customer’s subscription via the database:
- Find the ID of the subscription – this displays on the Manage Subscription table next to the subscription.
- Open MySQL editor (like PhpMyAdmin).
- Search the
wp_postmetatable for a row where thepost_IDis the ID found in step 1 and themeta_keyis'_requires_manual_renewal'. - If a row is found, change the
meta_valuefor that row totrue. - If a row was not found in step 3, insert a row into the
wp_postmetatable where thepost_IDis the ID found in step 1, themeta_keyis'_requires_manual_renewal'and themeta_valueistrue.
You can also bulk insert or update this meta data via a custom MySQL query for a batch of subscription IDs.
Change a Subscription to Manual Payments via PHP
↑ Back to topTo change a customer’s subscription using PHP:
- Find the ID of the subscription – this displays on the Manage Subscription table next to the subscription.
- In you PHP code, instantiate an instance of that subscription using
wcs_get_subscription( $subscription_id ) - Call
update_manual()on the subscription instance with a value oftrueto set the subscription to require manual renewals.