For developers who need different proration rules, the Proration and Delayed Downgrades Add On offers two filter hooks. Use them to change which level changes count as downgrades or which levels share a billing period. You can also replace the Add On’s checkout calculation with your own.

Filters

pmpro_is_downgrade

Determines whether a level change is a downgrade. Return true to delay the change until the member’s next payment date with $0 due at checkout. Return false to prorate the change as an upgrade. By default, a change is a downgrade when the new level costs less per day than the member’s current subscription.

This filter only runs for a change that could be a delayed downgrade: the member has an active, paid-up subscription for their current level, the new level is a different level, and the new level has no expiration date.

apply_filters( 'pmpro_is_downgrade', bool $is_downgrade, int $old_level_id, int $new_level_id );

Parameters

  • $is_downgrade: bool; Whether the change is a downgrade, based on cost per day.
  • $old_level_id: int; The ID of the level the member is switching from.
  • $new_level_id: int; The ID of the level the member is checking out for.

Example

Charge members the prorated annual price right away when they switch to your annual level (ID 5 in this example), instead of treating the switch as a downgrade.

function my_pmpro_annual_switch_is_not_a_downgrade( $is_downgrade, $old_level_id, $new_level_id ) {
	if ( 5 === (int) $new_level_id ) {
		return false;
	}
	return $is_downgrade;
}
add_filter( 'pmpro_is_downgrade', 'my_pmpro_annual_switch_is_not_a_downgrade', 10, 3 );

To rank your levels from lowest to highest tier instead of comparing prices, see the code recipe to override the default downgrade check.

pmpro_have_same_payment_period

Determines whether an upgrade uses the same-billing-period rules. When true, the member pays the difference for the rest of the current period and keeps their next payment date. When false, the member gets a credit toward the new level’s initial payment and the new subscription starts from the date of checkout. By default, the result is true when the member’s current subscription and the new level have the same billing cycle number and period.

This filter only runs for upgrades. We don’t recommend using it in most cases, but it lets you force the other set of rules for specific levels.

apply_filters( 'pmpro_have_same_payment_period', bool $same_payment_period, int $old_level_id, int $new_level_id );

Parameters

  • $same_payment_period: bool; Whether the two billing periods match.
  • $old_level_id: int|null; The ID of the level the member is switching from. In version 1.0.6, this is null on Paid Memberships Pro 3.0 and later. Use $new_level_id in your conditions.
  • $new_level_id: int; The ID of the level the member is checking out for.

Replace the Proration Rules

The Add On does all of its checkout math in the pmprorate_pmpro_checkout_level() function, hooked to the Paid Memberships Pro pmpro_checkout_level filter at priority 10. To use your own rules, remove that function and hook your own in its place. The Add On adds its filter when the plugin loads, so remove it on init or later.

function my_pmpro_use_custom_proration_rules() {
	remove_filter( 'pmpro_checkout_level', 'pmprorate_pmpro_checkout_level', 10 );
	add_filter( 'pmpro_checkout_level', 'my_pmpro_custom_proration_rules', 10 );
}
add_action( 'init', 'my_pmpro_use_custom_proration_rules' );

function my_pmpro_custom_proration_rules( $level ) {
	// Set $level->initial_payment, and $level->profile_start_date to change the first recurring payment date.
	return $level;
}

Your function receives the level object the member is checking out for, after any discount code is applied. Change initial_payment to set the amount due now. On Paid Memberships Pro 3.4 and later, set profile_start_date (in Y-m-d H:i:s format) to control when the first recurring payment is charged. Use the Add On’s function as your starting point.

Note: Delayed downgrades depend on the Add On’s checkout function. It marks the checkout as a downgrade so the Add On can schedule the level change. If you replace the function, downgrades are no longer delayed unless your code handles them.

Last updated on November 19, 2026


Was this article helpful?
YesNo