• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

RocketGeek

Home of WP-Members, The Original WordPress Membership Plugin

  • WordPress Plugins
    • WP-Members
      • FAQs
      • Quick Start
      • Documentation
      • Extensions
    • Advanced Options
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Download Protect
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Invite Codes
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • MailChimp Integration
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • PayPal Subscriptions
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Salesforce Web-to-Lead
    • Security
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Text Editor
      • Purchase the Plugin
      • Get the Pro Bundle
    • User List
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • User Tracking
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Memberships for WooCommerce
    • WordPass
  • Blog
    • Basics
    • Tips and Tricks
    • Filters
    • Actions
    • Code Snippets
    • Shortcodes
    • Design
    • Release Announcements
  • Store
    • Cart
    • Checkout
  • Contact
  • Log In
  • Show Search
Hide Search
Home » Plugins » Invite Codes » Invite Codes Documentation » WP CLI Commands

WP CLI Commands

Version 2.0.3 of the Invite Codes extension adds commands to the WP CLI interface.  These can be used for listing, managing, and editing existing codes, or adding new codes.  You can also add codes in bulk.

Get

The get command allows you to get a specific invite code or to get all codes.

Usage

The command wp mem ic get all will retrieve all existing codes in a list.

To get information about a specific code, specify the code in the command.  For example, to retrieve information about the “MyCode” invite code, use wp mem ic get MyCode.

Add

Adding codes can be done quickly if you want a random code value, or you can specify any or all of the attributes of an invitation code.  Any attributes left undefined will be set as a default value.

--code specifies the code name. Default: random value.

--desc specifies the description of the code.  Wrap the value in quotes if there are spaces (i.e. --desc="My code description")  Default: null.

--uses_remaining if the code is not unlimited, specify the number of uses. Default: null.

--bulk can set up bulk codes in a hurry.  Specify number of codes to create. Use code attributes above to specify specifics. Default: random code names.

--code_prefix used with --bulk attribute, specifies a prefix to all randomly generated code values. Default: off.

Usage

wp mem ic add will add a random code with default settings.

Example using attributes: wp mem ic add --code=MySpecialCode --desc="A special invite code" --uses_remaining=10 This would create “MySpecialCode” with the set description, available to be used 10 times.

Example of creating 10 bulk codes with a specified prefix: wp mem ic add --bulk=10 --code_prefix=Special --desc="Codes added in bulk". This would create 10 random codes prefixed by “Special” with the description “Codes added in bulk”.

Deactivate

Deactivates a specified code.

wp mem ic deactivate MySpecialCode would deactivate the “MySpecialCode” invite code.

Delete

Deletes a specified code.

wp mem ic delete MySpecialCode would delete the “MySpecialCode” invite code.

WP-Members Invite Codes

Plugin Info

Current Stable Version: 2.1.0
Minimum WordPress Version: 5.0
Tested up to WordPress Version: 6.5
Last Updated: 2024-04-06

Documentation

    • Setup
    • Importing Invite Codes
    • Upgrading
    • Filter Hooks
    • Action Hooks
    • API Functions
    • WP CLI Commands
    • Change Log

Get the Plugin

  • Purchase the Plugin
  • Get the Pro Bundle

Ready to get started?

Join Today!

© 2025 · butlerblog.com · RocketGeek is built using WordPress, WP-Members, and the Genesis Framework

  • butlerblog.com
  • WP-Members Support Subscription
  • Terms of Service
  • Privacy Policy
  • Refund Policy