Editing Template Files

Restrict Content Pro includes a template files system that makes it really simple for users to customize the registration form, profile form, login form, and more. This quick tutorial will walk you through how to use them to make modifications to the default plugin display.

The template files reside inside of wp-content/plugins/restrict-content-pro/templates, and there is a template file for:

  • The registration form - register.php, or register-single.php
  • The login form - login.php
  • The profile editor form - profile-editor.php
  • The change password form - change-password.php
  • Lost password form - lostpassword.php and lostpassword_checkemail.php
  • Credit card update form - card-update-form.php
  • Invoice form - invoice.php
  • PayPal Express confirmation form - paypal-express-confirm.php
  • Registration form totals section - register-total-details.php
  • Subscription details - subscription.php
  • Comments form - comments-no-access.php
  • WooCommerce template override - woocommerce-single-no-access.php

Any change you make to these files will be reflected in the display of the plugin, but in order to ensure that you can still update the plugin to the newest version without losing your changes, you need to copy the template files to a child theme ( https://codex.wordpress.org/Child_Themes) and then modify them there. To copy the templates to an upgrade-safe location, do the following:

  1. Create a folder called rcp inside of your active theme's folder. If you're using the default Twenty Twelve theme, you should create a child theme, your new folder will look like this: wp-content/themes/twenty-twelve-child/rcp
  2. Copy the files from the Restrict Content Pro templates directory into the new folder created in your theme
  3. Modify the files to your heart's content

When modifying these template files, you do need to be careful and not remove any form fields or unique element IDs that Restrict Content Pro depends on. If you notice any problems with the plugin's behavior after modifying any of these templates, delete your modified file (after backing it up), then test again to see if the problem is resolved. If removing your modified file resolves the issue, work backwards until you find the element you removed or changed that caused the problem. With the ability to modify template files, you have the freedom to setup the form markup exactly as you want, making it possible to create even the most beautiful membership forms. There is no limit.