Paid Memberships Pro (PMPro) uses a set of database tables to manage various aspects of its functionality.

Below is an overview of the database structure along with explanations of each table:

1. pmpro_discount_codes

This table stores information about discount codes.

  • id: Unique identifier for each discount code.
  • code: Discount code string.
  • starts: Start date of the discount.
  • expires: Expiry date of the discount.
  • uses: Number of times the discount has been used.

2. pmpro_discount_codes_levels

This table links discount codes to membership levels and defines specific pricing details for each level.

  • code_id: Foreign key linking to wp_pmpro_discount_codes.
  • level_id: Foreign key linking to wp_pmpro_membership_levels.
  • initial_payment: Initial payment amount.
  • billing_amount: Recurring billing amount.
  • cycle_number: Number of billing cycles.
  • cycle_period: Billing cycle period.
  • billing_limit: After how many cycles billing should stop.
  • trial_amount: Trial payment amount.
  • trial_limit: Number of trial cycles.
  • expiration_number: Number of cycles before membership expiration.
  • expiration_period: Period of time before membership expiration.

3. pmpro_discount_codes_uses

This table tracks the usage of discount codes.

  • id: Unique identifier for each discount code use.
  • code_id: Foreign key linking to wp_pmpro_discount_codes.
  • user_id: User ID associated with the discount code use.
  • order_id: Order ID associated with the discount code use.
  • timestamp: Timestamp of when the discount code was used.

4. pmpro_membership_levels

This table stores information about membership levels.

  • id: Unique identifier for each membership level.
  • name: Name of the membership level.
  • description: Description of the membership level.
  • confirmation: Confirmation message for new members.
  • initial_payment: Initial payment amount.
  • billing_amount: Recurring billing amount.
  • cycle_number: Number of billing cycles.
  • cycle_period: Billing cycle period.
  • billing_limit: After how many cycles billing should stop.
  • trial_amount: Trial payment amount.
  • trial_limit: Number of trial cycles.
  • allow_signups: Flag indicating whether signups are allowed.
  • expiration_number: Number of cycles before membership expiration.
  • expiration_period: Period of time before membership expiration.

5. pmpro_membership_levelmeta

This table stores metadata for membership levels.

  • meta_id: Unique identifier for each metadata entry.
  • pmpro_membership_level_id: Foreign key linking to wp_pmpro_membership_levels.
  • meta_key: Metadata key.
  • meta_value: Metadata value.

6. pmpro_membership_ordermeta

This table stores metadata for membership orders.

  • meta_id: Unique identifier for each metadata entry.
  • pmpro_membership_order_id: Foreign key linking to wp_pmpro_membership_orders.
  • meta_key: Metadata key.
  • meta_value: Metadata value.

7. pmpro_membership_orders

This table stores information about membership orders.

  • id: Unique identifier for each membership order.
  • code: Membership order code.
  • session_id: Session ID associated with the order.
  • user_id: User ID associated with the order.
  • membership_id: Membership level ID associated with the order.
  • paypal_token: Order details from PayPal using the token.
  • billing_name: Name entered on the billing address section, if applicable.
  • billing_street: Address entered on the billing address section, if applicable.
  • billing_city: City entered on the billing address section, if applicable.
  • billing_state: State entered on the billing address section, if applicable.
  • billing_zip: Zip Code entered on the billing address section, if applicable.
  • billing_country: Country entered on the billing address section, if applicable.
  • billing_phone: Phone number entered on the billing address section, if applicable.
  • subtotal: Subtotal amount.
  • tax: Tax amount.
  • checkout_id: Unique id to track multiple orders during the same checkout.
  • total: Total amount.
  • payment_type: Payment type (e.g., credit card, PayPal).
  • card_type: Credit card type (e.g., Visa, Mastercard, etc.)
  • accountnumber: Last 4 digits of the credit card used at checkout.
  • expirationmonth: Month the credit card expires.
  • expirationyear: Year the credit card expires.
  • status: Order status (e.g., pending, success).
  • gateway: Payment gateway used.
  • gateway_environment: Live or Sandbox
  • payment_transaction_id: Unique payment identifier for the charge.
  • subscription_transaction_id: Unique subscription identifiers for the charge, if applicable.
  • notes: Custom notes about the order that admin adds or used by other Add Ons to store information.

8. pmpro_memberships_categories

This table links membership levels to categories.

  • membership_id: Foreign key linking to wp_pmpro_membership_levels.
  • category_id: Category ID associated with the membership level.
  • modified: Timestamp of last modified.

9. pmpro_memberships_pages

This table links membership levels to pages.

  • membership_id: Foreign key linking to wp_pmpro_membership_levels.
  • page_id: Page ID associated with the membership level.
  • modified: Timestamp of last modified.

10. pmpro_memberships_users

This table tracks a user’s membership (separate of their membership orders) for deeper reporting. It also includes a list of statuses that you can use to build custom reports.

  • id: Unique identifier for each membership entry.
  • user_id: User ID associated with the membership.
  • membership_id: Membership level ID associated with the membership.
  • code_id: ID of the discount code used at checkout, if applicable.
  • initial_payment: Payment amount initial paid at checkout for the membership.
  • billing_amount: Recurring subscription amount, if applicable.
  • cycle_number: The number of billing cycles between recurring payments.
  • cycle_period: The length of a billing cycle. Possible values are “Day”, “Week”, “Month”, and “Year”.
  • billing_limit: The maximum number of recurring payments will be charged (“0” for unlimited).
  • trial_amount: The amount that a user is charged for recurring payments during a trial period.
  • trial_limit: The number of recurring payments that should be considered a trial.
  • status: Membership level status.
    • active: The user’s current membership level
    • admin_cancelled: The admin cancelled the user’s membership under the Users > Edit User page.
    • admin_changed: The user’s level was changed by the admin under the Users > Edit User page.
    • cancelled: The user cancelled their membership via the frontend page set as “Cancel Page” under Memberships > Page Settings
    • changed: The user changed their membership to another option via a frontend membership checkout
    • expired: The user’s membership expired and they did not renew or select a new level prior to expiration.
    • inactive: All of cases where the membership level changed. Also the status given to all inactive memberships before PMPro version 1.8.
  • startdate: Date the membership level began per member.
  • enddate: Date the membership level ended per member. Members with a recurring subscription do not have an end date until canceled.
  • modified: Timestamp of the last change for a specific membership.

11. pmpro_subscriptions

This table stores information about subscriptions.

  • id: Unique identifier for each subscription.
  • user_id: User ID associated with the subscription.
  • membership_level_id: Membership level ID associated with the subscription.
  • gateway: Payment gateway used.
  • gateway_environment: Live or Sandbox
  • subscription_transaction_id: Unique subscription identifiers for the charge, if applicable.
  • status: Subscription status (e.g., active, cancelled).
  • startdate: Date the subscription started.
  • enddate: Date the subscription ended.
  • next_payment_date: Next subscription payment date.
  • billing_amount: Recurring subscription amount.
  • cycle_number: The number of billing cycles between recurring payments.
  • cycle_period: The length of a billing cycle. Possible values are “Day”, “Week”, “Month”, and “Year”.
  • billing_limit: The maximum number of recurring payments will be charged (“0” for unlimited).
  • trial_amount: The amount that a user is charged for recurring payments during a trial period.
  • trial_limit: The number of recurring payments that should be considered a trial.
  • modified: Timestamp of the last change for the subscription.

12. pmpro_subscriptionmeta

This table stores metadata for subscriptions.

  • meta_id: Unique identifier for each metadata entry.
  • pmpro_subscription_id: Foreign key linking to wp_pmpro_subscriptions.
  • meta_key: Metadata key.
  • meta_value: Metadata value.

13. pmpro_groups

This table stores information about your membership level groups.

  • id: Unique identifier for each level group.
  • name: Name of the level group.
  • allow_multiple_selections: Flag indicating whether multiple selections are allowed.
  • displayorder: The order the groups show in on the levels page or in the admin.

14. pmpro_membership_levels_groups

This table links membership levels to level groups.

  • id: Unique identifier for each entry.
  • level: Membership level ID associated with the entry.
  • group: Group ID associated with the entry.

These tables collectively form the database structure for Paid Memberships Pro, facilitating the management of memberships, orders, discounts, and related data.

Was this article helpful?
YesNo