Restrict Content Pro, my plugin for selling premium memberships and restricting site content to paid subscribers, 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
  • The login form
  • The profile editor form
  • The change password form

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 your theme 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, your new folder will look like this: wp-content/themes/twenty-twelve/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.

  1. Rami Y

    Great tip, i didnt know that i can do that.

    Thanks.

    • Pippin

      It was added in v1.5 but was largely undocumented.

  2. Andrew

    The possibilities with this plugin and addons continue to amaze me. Thanks Pippin.

    And thanks for your session on WPSessions on Saturday. Great stuff.

  3. Jeremy Saxey

    Would be nice if there was a template for the [subscription_details] shortcode. The output on the help pages doesn’t mention that it’s going to output the Payment History as well. My clients want to remove that part from the subscription details but I see no way to do that besides modifying the plugin code, which of course, is no solution if we’re being good developers 🙂

    • Pippin

      It’s on my todo list!

  4. Peter Rood

    Is there a possibility to approve a new subscriber before he logs in to the site.
    Is it possible to have a default acces slevel (none) when subscribe as a new member?
    Is it possible the hide the wordpress bar ?

    Thanks

    • Pippin

      Please open these questions a support ticket so that I can keep comments on this page relevant to the tutorial: https://pippinsplugins.com/support

  5. Alexander

    Hello,

    thank you for the tutorial. I created a custom login page within the register.php template and additional fields are saved to the db as described here [https://pippinsplugins.com/add-custom-user-meta-fields-to-restrict-content-pro-registration/]
    with hooking into the ‘rcp_form_processing’ action.

    The same i tried with the profile-editor.php but it seems that action hook ‘rcp_form_processing’ is not running for editing form data within the edit section.

    Searched the files but do not find the action hook i can hook into the is processing the form fields of the profile-editor.php.

    How can customizing be done for the profile-editor.php template?

    Thank you,
    Alexander

  6. Alexander

    Good evening, is there any chance to edit additional fields on the profile-editor.php that are build within the register.php template?

    Any hint much appreciated if that would be possible.

    Thank you,
    Alexander

  7. Pippin

    Yes you can, simply add the new fields to the profile template and make the necessary get_user_meta() calls.

    Does that make sense?

  8. Alexander

    I did but was searching for the missing link as i tried first to use the action hook ‘rcp_form_processing’ but found that it is not running when editing form data within the edit section.

    Now i found the ‘rcp_user_profile_updated’ hook and now it’s working thank you. May it possible to have a list of all action and filter hooks to be able to deal with?

    Not quite sure if this is a typo so just a hint: Line 21&25 in profile-editor.php both ‘first_name_wrap’

    Thank you

    • Pippin

      Great!

      I’ll try and get a list updated, and thanks for the typo note!

  9. Craig Grella

    Pippin,

    do you have a link to any more tutorials on modifying the registration form for RCP?
    I’d like to include some custom fields for my registrants?
    i’ve got premium access on your site as well.

    Also, when copying these files to my own custom theme do I copy all the files or just the templates I need to modfy?

    Thanks.

  10. DANIEL MORIYA

    Can I edit the labels from the template files to my language, instead trying to translate it?

    I alreday did that, but it’s not working.

    Thanks

    • Pippin

      Yep! You can change any HTML you want.

    • DANIEL MORIYA

      Thanks, it´s working fine.

  11. Steve Ariss

    I’m pretty sure no is the answer to this as I can’t see any hooks in your rcp_locate_template function, but any chance I can change where the plugin looks for the template files? Just like to keep my theme folder organized.

    • Pippin

      No, sorry, the location cannot be changed at this time.

  12. Ros Sumiati

    Is there any change to make it working with Genesis child theme?
    I edit the HTML but the form is not changed. In fact the template I’ve copied to the child the is not called.
    Is there any additional code to make it live?

    • Pippin

      As long as you place it inside of the child theme, it should work fine. Is that where you put it?

  13. Jonathan

    Good tutorial.

    I want to make First Name and Last Name required and have copied the templates I need for that and given those fields class=”required”. Two questions:

    1. How do I validate that so the error shows on the form if they’re not filled out?

    2. What’s the difference between register-single.php and register.php?

  14. fullmoonfridy

    Hello, I would like to use the [login-form] short code on my 404.php file. I have tried using the stadrar login template, but this doesnt quitework correctly as the user is logged back out on every page request. So I am presuming it is best to use the shortcode, but how can I do this through php? Thanks in Advance.

Comments are closed.