MyListing Persistent Drafts
The {CODICTS} MyListing Persistent Drafts plugin solves a common workflow problem with MyListing: when users visit the “Add Listing” page, the theme normally creates a brand-new draft each time. This plugin intercepts that behavior and redirects users to their existing draft instead — enabling a “resume where you left off” experience and preventing duplicate drafts.
The plugin also provides a listing limit feature that restricts how many listings a user can create per listing type, with configurable redirect behavior when the limit is reached.
Installation & Activation
Start by downloading the plugin from the Downloads page on your dashboard on the CoDicts website.
After downloading, install and activate the plugin in WordPress by navigating to “Plugins” > “Add New” > “Upload Plugin” and selecting the downloaded zip file. Click “Install Now” and then “Activate”.
After activation, navigate to Persistent Drafts in the admin sidebar to configure the plugin for your listing types.
Key Features
| Feature | Description |
|---|---|
| Persistent Draft Redirect | Automatically redirects users from the “Add Listing” page to their existing draft instead of creating a new one. |
| Multi-Status Detection | Detects existing listings across multiple statuses: Draft, Expired, Pending, Pending Payment, Unpublished, and Published. |
| Listing Limit per Type | Restrict users to a maximum number of listings per listing type (e.g., only 1 Business listing allowed). |
| Configurable Limit Redirect | When a listing limit is reached, redirect users to their latest listing’s edit page or a custom page of your choice (e.g., an upgrade/pricing page). |
| Custom Page Detection | Register pages outside the default Add Listing page that should also trigger draft detection and redirect behavior. |
| Button Text Modification | Dynamically change the text of links pointing to custom pages based on whether the user has a draft or a published listing. |
| Pending Payment Redirect | Automatically redirects users with “pending payment” listings to their WooCommerce order page to complete payment. |
| Per-Type Configuration | Enable or disable persistent draft behavior independently for each listing type with its own limit and status settings. |
How It Works
When a logged-in user visits a page you’ve registered as an “Add Listing” page, the plugin checks whether the user already has an existing listing (draft or other configured status) for that listing type. If one is found, the user is automatically redirected to edit that listing instead of creating a new draft.
Persistent Draft Redirect
| Scenario | What Happens |
|---|---|
| User has an existing draft | Redirected to edit the draft — they pick up where they left off. |
| User has no existing listing | Normal MyListing behavior — a new draft is created as usual. |
| User just submitted a listing | No redirect — the submission success message is shown normally. |
| User is already editing a listing | No redirect — the edit form loads normally. |
| User is not logged in | No action — the plugin only affects logged-in users. |
Listing Limit
When the listing limit feature is enabled for a listing type, the plugin counts the user’s existing listings (across the statuses you configure) and compares against the limit:
| Scenario | What Happens |
|---|---|
| User’s listing count is below the limit | Normal behavior — user can create a new listing. |
| User’s listing count has reached the limit | Redirected to their latest listing’s edit page, or to a custom page you configure (e.g., a pricing/upgrade page). |
Pending Payment Handling
If a user has a listing in “pending payment” status and there’s a matching WooCommerce order awaiting payment, the plugin redirects them to the WooCommerce orders page so they can complete payment. If no matching order is found, the listing is loaded in the Add Listing form for editing.
Note: The pending payment redirect requires WooCommerce to be active on your site.
Settings Page
Navigate to Persistent Drafts in the WordPress admin sidebar.
The settings page has three main sections:
1. Add Listing Pages
| Control | Description |
|---|---|
| Select the add listing pages | Choose all pages on your site that contain the MyListing “Add Listing” widget. The plugin monitors these pages to trigger the persistent draft redirect. You can search for pages by title — the dropdown loads via AJAX so it works well even on sites with thousands of pages. |
2. Custom Pages
Custom Pages let you register additional pages that don’t contain the Add Listing widget but should still trigger draft detection. This is useful for pages with custom “Add Listing” buttons or calls-to-action.
Click “Add” to add a custom page entry. Each entry has these fields:
| Field | Description |
|---|---|
| Custom Page | The WordPress page to monitor (searchable dropdown). |
| Listing Type | The listing type associated with this page. |
| Draft Button Text Modification | Custom text to display on links pointing to this page when the user has a draft listing (e.g., “Continue My Draft”). |
| Published Button Text Modification | Custom text to display on links pointing to this page when the user has a published listing (e.g., “Edit My Listing”). |
You can add multiple custom page entries. Remove any entry with the “Delete” button.
How button text modification works: The plugin finds all links on the page that point to the custom page URL and replaces their text based on the user’s listing status. For example, an “Add Business” button can automatically become “Continue My Draft” or “Edit My Business” depending on whether the user already has a listing.
3. Listing Type Configuration
Below the Custom Pages section, the settings page shows a configuration block for each listing type registered in MyListing. Each listing type has the following controls:
| Setting | Default | Description |
|---|---|---|
| Enabled? | Off | Enables persistent draft behavior for this listing type. When disabled, the Add Listing page works normally for this type. |
| Allowed listings limit | Off | Enables the listing count limiter. Only visible when Enabled is checked. |
| Listing limit | 1 | Maximum number of listings a user can have (across the selected statuses) before being redirected. |
| Include listing status | Draft (locked) | Which listing statuses count towards the limit. Draft is always included and cannot be unchecked. Available options: Draft, Expired, Pending approval, Pending payment, Unpublished, Published. |
| Redirect settings | Redirect to latest listing | Where to redirect the user when the limit is reached. Choose “Redirect to latest listing” (the user’s most recent matching listing) or select any WordPress page (e.g., a pricing page). |
| Make default listing type | Off | When the Add Listing page supports multiple listing types and no specific type is selected in the URL, this type is used as the default for draft detection. |
Status priority: When multiple listings match, drafts are always checked first. Within the same status, the most recent listing is selected. This means the user is always directed to their most relevant in-progress listing.
Example Setup: Basic Persistent Drafts
This example sets up persistent drafts so users are always redirected to their existing draft instead of creating duplicates.
1. Activate the plugin with the MyListing theme active.
2. Go to Persistent Drafts in the admin sidebar.
3. In “Select the add listing pages”, search for and select the page(s) that contain the MyListing Add Listing widget.
4. Scroll down to your listing type (e.g., “Business”) and check “Enabled?”
5. Leave “Allowed listings limit” unchecked — this means any existing draft will trigger a redirect, regardless of how many listings the user has.
6. Save settings.
7. Test by creating a draft as a regular user, navigating away, then returning to the Add Listing page. You’ll be redirected to your existing draft instead of starting a new one.
Example Setup: Limit Users to 1 Listing
This example restricts users to a single listing per type, redirecting them to edit their existing listing if they try to create another.
1. Follow steps 1–3 from the basic setup above.
2. Under your listing type, check “Enabled?”
3. Check “Allowed listings limit”.
4. Set “Listing limit” to 1.
5. Under “Include listing status”, check the statuses that should count towards the limit — for example, check Published and Pending approval along with the always-included Draft.
6. Set “Redirect settings” to “Redirect to latest listing” (the user goes to edit their existing listing) or select a custom page like a pricing/upgrade page.
7. Save settings.
8. Test: create and publish a listing as a regular user, then try to visit the Add Listing page again. You’ll be redirected to your existing listing instead of being able to create a second one.
Example Setup: Custom Page with Button Text
This example registers a custom landing page that changes its “Add Listing” button text based on the user’s listing status.
1. Complete the basic setup above.
2. In the Custom Pages section, click “Add”.
3. Select the landing page in “Custom Page”.
4. Choose the associated “Listing Type”.
5. Set “Draft Button Text Modification” to “Continue My Draft”.
6. Set “Published Button Text Modification” to “Edit My Listing”.
7. Save settings.
8. Any link on the site that points to this custom page will now have its text automatically changed — “Continue My Draft” if the user has a draft, or “Edit My Listing” if they have a published listing.
Frequently Asked Questions
Does this require a child theme?
No. The plugin works entirely via WordPress hooks and JavaScript without modifying any theme files.
What happens when a user visits the Add Listing page?
If the plugin is configured for that listing type and the user has an existing draft (or listing matching the configured statuses), they are redirected to edit that listing. If no existing listing is found, the normal Add Listing behavior proceeds and a new draft is created.
Can I limit users to more than one listing?
Yes. The “Listing limit” field accepts any positive number. For example, setting it to 3 allows each user to have up to 3 listings of that type before being redirected.
What listing statuses can count towards the limit?
Draft (always included), Expired, Pending approval, Pending payment, Unpublished, and Published. You can select any combination.
What happens when the listing limit is reached?
Two options: redirect to the user’s latest matching listing (so they can edit it), or redirect to any custom WordPress page (e.g., a pricing or upgrade page).
Can I use this with multiple listing types?
Yes. Each listing type gets its own independent configuration with its own enable/disable toggle, limit, status settings, and redirect behavior.
What are Custom Pages for?
Custom Pages are pages on your site that don’t contain the Add Listing widget but still link to the listing creation flow. The plugin monitors these pages and can modify button text on links pointing to them based on the user’s listing status (e.g., changing “Add Listing” to “Continue Draft”).
How does the pending payment redirect work?
If a user has a listing in “pending payment” status and there’s a matching WooCommerce order awaiting payment, the plugin redirects to the WooCommerce orders page so they can complete payment. This requires WooCommerce to be active.
What is “Make default listing type”?
When the Add Listing page supports multiple listing types and no specific type is selected in the URL, the plugin needs to know which type to check for drafts. Marking a type as “default” tells the plugin which one to use in that scenario.
Does this affect non-logged-in visitors?
No. The plugin only runs for logged-in users. Anonymous visitors see the normal page behavior.
Is there a brief page flash before the redirect?
Yes. The redirect is performed via JavaScript, so the original page briefly loads before the redirect occurs. This is most noticeable on slower connections.
What happens when I deactivate the plugin?
The persistent draft redirect and button modifications stop. The Add Listing page returns to normal MyListing behavior (creating a new draft each time). No listings or user data are affected.
Troubleshooting
User Not Being Redirected to Their Draft
| Cause | Solution |
|---|---|
| Listing type not enabled | Go to Persistent Drafts settings and make sure the checkbox “Enabled?” is checked for the relevant listing type. |
| Add Listing page not registered | Under “Select the add listing pages,” make sure the page containing the Add Listing widget is selected. |
| User has no existing draft | The redirect only occurs when the user already has a listing matching the configured statuses. If they have no draft, a new one is created normally. |
| User is not logged in | The plugin only works for logged-in users. |
| JavaScript disabled | The redirect requires JavaScript. Check the browser console for errors. |
| User just submitted a listing | The plugin intentionally skips the redirect when the submission success message is displayed to avoid a redirect loop. |
| User is already editing a listing | The plugin skips the redirect when both job_id and listing_type are in the URL, meaning the user is already on an edit form. |
Listing Limit Not Working
| Cause | Solution |
|---|---|
| “Allowed listings limit” not enabled | Check that both “Enabled?” and “Allowed listings limit” are turned on for the listing type. |
| Wrong statuses selected | Make sure the statuses you want to count toward the limit are checked under “Include listing status.” For example, if you want published listings to count, check “Published.” |
| Limit value too high | Verify the “Listing limit” number. If set to 5, users can create up to 5 listings before being redirected. |
Button Text Not Changing on Custom Pages
| Cause | Solution |
|---|---|
| Custom page not configured | Add the page in the Custom Pages repeater section and make sure both the page and listing type are selected. |
| No matching listing found | Button text only changes when the user has an existing listing for the associated listing type. |
| Link URL doesn’t match | The plugin finds links by matching their href to the custom page URL. If the link URL doesn’t match exactly (e.g., extra query parameters), the text won’t be modified. |
Pending Payment Redirect Not Working
| Cause | Solution |
|---|---|
| WooCommerce not active | The pending payment redirect requires WooCommerce. Ensure it’s installed and active. |
| No matching order | The redirect only works when there’s a WooCommerce order in “pending” or “on-hold” status linked to the listing. If the order was cancelled or completed, the listing loads in the edit form instead. |
Wrong Listing Type Being Detected
| Cause | Solution |
|---|---|
| No default listing type set | If your Add Listing page supports multiple types and no type is specified in the URL, the plugin doesn’t know which type to check. Set one listing type as the default using “Make default listing type” in the settings. |
“MyListing Theme Not Detected” Error
The MyListing theme must be installed and active. Go to Appearance → Themes to verify.
For further support, visit codicts.com or contact us at support@codicts.com.