Appearance
Redirect Posts
The Redirect Posts function automatically redirects visitors when they try to access posts with specific statuses. Use this to redirect pending, draft, or unpublished posts to a custom URL.
Overview
When users try to access a post that’s pending review or in another non-published status, WordPress may show a 404 error or the post content. This function lets you redirect them to a more useful page instead.
Key Features
- Redirect posts based on status
- Configure different redirect URLs per post type
- 301 permanent redirect for SEO
- Catches posts before 404 errors
- Works with all public post types
Setup Instructions
Step 1: Enable the Function
- Navigate to Voxel Toolkit → Functions in your WordPress admin
- Find Redirect Posts in the list
- Toggle the switch to enable the function
- Click Save Changes
Step 2: Configure Redirect Statuses
- In the Redirect Statuses section, select which post statuses should trigger redirects
- Common choices: pending, draft, private
- Click Save Changes
Step 3: Set Redirect URLs
- For each post type, enter the URL to redirect to
- Use full URLs (e.g., https://yoursite.com/coming-soon/)
- Click Save Changes
Configuration Options
Redirect Statuses
| Status | Description |
|---|---|
| pending | Posts awaiting review |
| draft | Unpublished drafts |
| private | Posts only visible to admins |
| future | Scheduled posts not yet published |
Per-Post Type URLs
Configure different redirect destinations for each post type:
- Places: → /explore-places/
- Events: → /upcoming-events/
- Jobs: → /job-board/
- Posts: → /blog/
How It Works
- User tries to access a post URL
- Function checks the post status
- If status is in the configured list, redirect is triggered
- User is redirected with a 301 (permanent) redirect
SEO Note
The function uses 301 redirects, which tell search engines the redirect is permanent. This is appropriate for posts that shouldn’t be indexed in their current status.
Use Cases
Pending Listings
When a listing is pending review, redirect visitors to the main listing archive instead of showing an error.
Draft Content
Prevent users from accessing draft URLs (which could be shared accidentally) by redirecting to a relevant page.
Scheduled Posts
Redirect visitors who find scheduled post URLs before they’re published.
Troubleshooting
Redirect Not Working
- Verify the function is enabled
- Check that the post status is in the configured list
- Ensure a redirect URL is set for the post type
- Check for caching issues
Wrong Redirect URL
- Verify the URL is entered correctly in settings
- Ensure URL includes https:// or http://
- Check that the destination page exists
Logged-In Users Still Seeing Posts
Note: WordPress may show pending/draft posts to users who can edit them. The redirect applies to users who would normally see a 404.

