Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/moo-digital/moo-digital-landing-pages/archive/refs/heads/main.zipA lightweight WordPress plugin that adds a custom post type for Landing Pages with full page-like functionality, perfect for managing marketing campaigns and conversion-focused pages.
Features
- Custom Post Type: Dedicated "Landing Pages" post type separate from regular pages and posts
- Page-Like Functionality: Full support for parent/child hierarchies, page attributes, and templates
- Gutenberg Ready: Full block editor support for modern page building
- SEO-Friendly URLs: Clean
/lp/page-nameURL structure - Moo Digital Integration: Integrates with the shared Moo Digital admin menu
- Full Feature Set: Thumbnails, excerpts, custom fields, revisions, and more
- Navigation Menu Support: Add landing pages to WordPress menus
- Template Support: Use custom page templates from your theme
Why Use This Plugin?
Separation of Concerns
Keep your landing pages separate from regular website pages, making them easier to:
- Manage and organise
- Track in analytics
- Apply different templates or styling
- Export or migrate separately
Marketing Benefits
- Dedicated section for campaign pages
- Easy to identify and manage conversion pages
- No clutter in your main Pages section
- Quick access via the Moo Digital menu
Developer Benefits
- Clean URL structure (
/lp/prefix) - Same capabilities as standard pages
- Hierarchical for organised campaign groupings
- Easy to query separately in code
Installation
- Download the plugin file
- Upload
moo-digital-landing-pages.phpto/wp-content/plugins/ - Activate the plugin through the 'Plugins' menu in WordPress
- Access landing pages via Moo Digital > Landing Pages in the WordPress admin
Usage
Creating a Landing Page
- Navigate to Moo Digital > Landing Pages in the admin menu
- Click Add New
- Create your landing page just like a regular WordPress page
- Publish when ready
Your landing page will be accessible at: https://yoursite.com/lp/your-page-name/
Available Features
When creating/editing landing pages, you have access to:
- Title & Content: Full Gutenberg block editor
- Featured Image: Set a thumbnail/hero image
- Excerpt: Short description (useful for meta descriptions)
- Page Attributes:
- Parent page (create hierarchies)
- Order (control display order)
- Template (use custom templates from your theme)
- Custom Fields: Add any custom data you need
- Revisions: Full revision history
Adding to Navigation Menus
Landing pages can be added to WordPress menus:
- Go to Appearance > Menus
- Look for the "Landing Pages" section in the left panel
- Select the landing pages you want to add
- Click "Add to Menu"
Using Custom Templates
If your theme supports custom page templates, you can use them with landing pages:
- Create a template file in your theme (e.g.,
template-landing.php) - Add the template header:
<?php /** * Template Name: Landing Page Template * Template Post Type: lp */ - Select the template in the Page Attributes panel when editing a landing page
URL Structure
Landing pages use the /lp/ URL prefix by default:
- Single page:
https://yoursite.com/lp/summer-sale/ - Child page:
https://yoursite.com/lp/campaigns/summer-sale/
This makes it easy to:
- Identify landing pages in analytics
- Set up tracking rules
- Apply different caching rules
- Create specific redirect rules
Changing the URL Prefix
To change the URL prefix from /lp/ to something else, modify line 82 in the plugin:
'rewrite' => [
'slug' => 'your-prefix', // Change 'lp' to your preferred prefix
'with_front' => false,
],
After changing, visit Settings > Permalinks and click "Save Changes" to flush rewrite rules.
Permissions
Landing pages use the same permission system as regular pages:
- Create: Requires
edit_pagescapability - Edit: Requires
edit_pagescapability - Delete: Requires
delete_pagescapability - Publish: Requires
publish_pagescapability
This means any user who can manage regular pages can also manage landing pages.
Theme Integration
Querying Landing Pages
To display landing pages in your theme:
<?php
$args = array(
'post_type' => 'lp',
'posts_per_page' => 10,
'orderby' => 'date',
'order' => 'DESC'
);
$landing_pages = new WP_Query($args);
if ($landing_pages->have_posts()) :
while ($landing_pages->have_posts()) : $landing_pages->the_post();
// Display your landing page
the_title();
the_content();
endwhile;
wp_reset_postdata();
endif;
?>
Template Hierarchy
WordPress will look for templates in this order:
single-lp.php(specific to landing pages)single.php(generic single template)singular.php(generic singular template)index.php(fallback)
Create a single-lp.php file in your theme for custom landing page styling.
Checking if Current Page is a Landing Page
<?php
if (is_singular('lp')) {
// This is a landing page
// Apply custom styling or functionality
}
?>
Features Breakdown
Supported Features
- ✅ Title: Standard page title
- ✅ Editor: Full Gutenberg block editor
- ✅ Author: Track who created the page
- ✅ Thumbnail: Featured image support
- ✅ Excerpt: Short description
- ✅ Page Attributes: Parent, order, template selection
- ✅ Custom Fields: Full custom field support
- ✅ Revisions: Complete revision history
Disabled Features
- ❌ Archive Page: No archive listing (intentional)
- ❌ Comments: Not enabled (landing pages typically don't need comments)
- ❌ Trackbacks: Not enabled
Configuration Options
The following are configured in the plugin:
- Public: Yes (visible on frontend)
- Publicly Queryable: Yes (can be accessed via URL)
- Show in REST API: Yes (Gutenberg support)
- Hierarchical: Yes (parent/child relationships like pages)
- Can Export: Yes (can be exported via WordPress tools)
Requirements
- WordPress 5.0 or higher (for Gutenberg support)
- PHP 7.0 or higher
Plugin Structure
moo-digital-landing-pages.php (single file plugin)
This plugin follows the K.I.S.S. principle - everything is contained in a single file for simplicity.
Troubleshooting
Landing pages show 404 errors
After activating the plugin, you need to flush rewrite rules:
- Go to Settings > Permalinks
- Click "Save Changes" (you don't need to change anything)
- Try accessing your landing page again
Landing pages don't appear in the admin menu
Check that the plugin is activated and there are no PHP errors. The landing pages should appear under Moo Digital > Landing Pages.
Can't find landing pages in the default Posts/Pages menus
This is intentional. Landing pages have their own section under the Moo Digital menu to keep them separate from regular content.
Want to add custom fields
Landing pages support custom fields by default. You can:
- Use the classic custom fields box (enable it via Screen Options)
- Use Advanced Custom Fields (ACF) or similar plugins
- Use custom field blocks in Gutenberg
SEO Considerations
Landing pages work seamlessly with popular SEO plugins:
- Yoast SEO: Full support for page analysis and meta data
- Rank Math: Complete SEO control
- All in One SEO: Full compatibility
The excerpt field can be used for meta descriptions if your SEO plugin supports it.
Performance
This plugin has minimal impact on performance:
- Single file, lightweight code
- No database queries beyond standard WordPress functions
- No frontend scripts or styles loaded
- Registers only one custom post type
Use Cases
- Marketing Campaigns: Separate pages for different campaigns
- Product Launches: Dedicated landing pages for new products
- Lead Generation: Conversion-focused pages with forms
- Event Promotion: Individual pages for events or webinars
- A/B Testing: Create multiple variations for testing
- Seasonal Promotions: Holiday or seasonal campaign pages
- PPC Landing Pages: Dedicated pages for paid advertising
Changelog
1.0.0
- Initial release
- Custom post type registration
- Page-like functionality
- Gutenberg support
- Moo Digital menu integration
- Hierarchical structure
- Custom URL structure (
/lp/)
License
GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Credits
Created by Moo Digital Ltd.
Support
For support or feature requests, please contact Moo Digital or submit an issue on the GitHub repository.