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_postmeta
table for a row where thepost_ID
is the ID found in step 1 and themeta_key
is'_requires_manual_renewal'
. - If a row is found, change the
meta_value
for that row totrue
. - If a row was not found in step 3, insert a row into the
wp_postmeta
table where thepost_ID
is the ID found in step 1, themeta_key
is'_requires_manual_renewal'
and themeta_value
istrue
.
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 oftrue
to set the subscription to require manual renewals.