Are you building a directory or classified ads website? Do your users pay to submit posts? Did you know Formidable is an easy pay-per-post solution?
Pay-per-post solutions for WordPress have been around for years. They are essential when building an online directory or classified ads website. Users pay a small fee for each ad they place or each listing they submit.
This is kind of the opposite of restricted content. Instead of selling access to pages, you accept payment and allow users to upload a page or post on your WordPress website.
You may have seen that there are several pay-per-post plugins too. These come with a lot of options, like custom post types, various payment gateways, and even options to post with WooCommerce!
But depending on what you are trying to do, a dedicated WordPress plugin that only handles one thing might be overkill. For example, the plugin "WooCommerce pay per post" will only allow you to add one simple feature to your site.
In this tutorial, we are going to show you how a WordPress form builder can give you the most powerful pay-per-post options of all! Let's get into it.
Looking for ways to "restrict content"?
Before we get started, let's make sure you aren't looking for something else. Many people get the concept of "pay-per-post" twisted up with "restricted content". These are not the same thing!
If you are looking for a way to help users access restricted content like digital downloads and subscription plans, then you might want to check out the following post: 4 Ways to Protect WordPress Media Files.
Set up pay-per-post with a form builder plugin
Since there are many scenarios where pay-per-post can be used, the following method is flexible enough to work however you need! Although you can't do this using the free version of Formidable Forms, our premium versions are worth checking out.
Not only will you be able to handle pay-per-post with ease, but you'll get access to a huge range of features that will improve every aspect of your WordPress site. Check out our pricing plans to learn more!
Step 1 - Build a WordPress pay-per-post form
Add the fields you need to create a new post, including a title and the main text content. A contact number, address, and a featured image upload are a great base. For a classifieds website, you might want to add fields for the item category, item condition, and item price.
Add a Post Status field to your form which defaults to "draft". Mark this field as read-only and set the visibility to "Administrator".
It is often sensible to require users to register before submitting a new listing. Add a User ID field to your form to create a link between form submissions and the logged-in user that created them. This allows users to edit and update their own listings from the frontend.
Step 2 - Set up your form to create a WordPress post
The action to create a new post can be as simple or as complex as you'd like. A single field for your post content gives a quick and simple layout. Or create a View to display your content with a more customized layout and style. This option allows you to create almost any kind of look you can imagine, so it is often worth the extra effort.
Read more: How to setup front-end posting in WordPress
Step 3 - Require payment before the post is published
The Post Status field you set up in step 1 means that your form will save new posts as drafts. These drafts will be published once the payment is completed.
To enable pay-per-post functionality, we need to activate a payment method. Add a payment action to your form using either PayPal or Stripe. These two gateways offer instant transactions and automatic confirmation. Payment confirmation triggers post publishing.
Set the "After Payment" action to change your Post Status field to "publish" on payment completion.
Step 4 - Display your paid posts
This step depends a lot on your theme. Most themes have built-in templates to display posts in an attractive way with minimal customization.
Display your listings with the most recent first. Ensure that your navigation and search allows users to quickly and easily find what they want.
Step 5 - Let users edit their listings
Allowing your users to edit and update their own entries is essential. This can easily be done with a View that is filtered by the current user.
You should also include a deletelink so listings that have sold or are no longer valid can be easily removed by the user.
Bonus step - Auto expire the user-submitted posts
Pay-per-post sites work in multiple ways. Some pay once for a lifetime post, others require renewal to keep the post published, or simply remove the post after 30 days. The form action automation add-on will conditionally trigger an API call. That API call will change the status of the post back to draft.
Pretty awesome right? Wait though - it gets even better!
Similar pay-per-post systems can use Views instead of posts. This has two major advantages:
- It's easier to build custom layouts for your listings.
- Built-in filtering options for easier auto-expiration listings after a set time period.
The process is very similar to what is shown above. Step 1 is the same, except the Post Status field should be a normal dropdown instead of the one added via the create post action. Step 2 can be skipped completely, and Step 3 remains the same.
Things change a little in step 4. Instead of creating a post, use a View instead.
The View type you need is Dynamic (both). Setup your main content to display an overview of your listings, with the most important information and an excerpt of the main text. Then the detail page contains in-depth information.
The View gives you full control, allowing you to customize the HTML directly. Setup any layout you wish. For many business directories, a single column layout may be preferable. But for a classified adverts site, a three or four-column layout often works best.
As you can see, there are a ton of customization options at every step! With Formidable Forms, you'll be able to set up pay-per-post however you want... plus you'll be able to do a whole lot more. Check back often to see more tips on the Formidable blog! Bye for now.
Not using Formidable Forms yet? Download the most powerful form, creator, and application builder, today!