Charitable Documentation

Learn how to make the most of Charitable with clear, step-by-step instructions.

Disable the Auto-Created Single Campaign Page

When you create a campaign in Charitable, WordPress automatically gives it its own public URL at /campaigns/[campaign-slug]/. That happens because Charitable registers campaigns as a public custom post type, which is what allows search engines and direct links to reach a campaign’s own page.

That works well if you want every campaign to have its own landing page. But if you only want donors to reach your campaign through a specific page on your site, for example a single /donate/ page where you’ve embedded the campaign with the shortcode or block, the auto-created URL becomes a second, unwanted entry point.

This page covers two ways to remove that entry point. Both options leave your campaign embed working exactly as before, because the embed reads the campaign record directly from the database. It does not rely on the single campaign URL being publicly accessible.

When you’d use this

  • You embed your campaign on a dedicated donate page and want that to be the only place donors land.
  • A campaign URL is showing up in search results or being shared, and you want to send those visitors to your donate page instead.
  • You only run one campaign at a time and the single-campaign URL is redundant.

Why the URL exists in the first place

Charitable registers campaign as a WordPress custom post type with public => true and publicly_queryable => true. Those two flags are what tell WordPress to generate a URL for each campaign and serve it through the single-post template.

The URL pattern is [your-permalink-front]/campaigns/[campaign-slug]/. If your WordPress permalink structure has a front, for example /news/%postname%/, the campaign URL becomes /news/campaigns/[campaign-slug]/. That’s standard WordPress behavior, not a Charitable setting.

There’s no built-in toggle in the Charitable settings to disable the single campaign URL. The two snippets below are the supported ways to turn it off.

Option 1: Redirect single campaign URLs to your donate page (recommended)

This is the option to choose if there’s any chance a campaign URL has already been shared, indexed, or linked from elsewhere. Visitors who land on the campaign URL get sent to your donate page with a 301 redirect, which search engines respect over time.

Add this snippet using a code snippets plugin (such as WPCode) or your child theme’s functions.php:

add_action( 'template_redirect', function() {
    if ( is_singular( 'campaign' ) ) {
        wp_safe_redirect( home_url( '/donate/' ), 301 );
        exit;
    }
} );

Change /donate/ to whatever URL you want to send visitors to. After saving the snippet, open your campaign’s URL in a private browser window to confirm it now lands on your donate page.

Option 2: Make the campaign post type non-public

This option turns off the single campaign URL entirely. Anyone visiting /campaigns/[slug]/ will see a standard WordPress 404. Use this if you’d rather the URL not exist at all than redirect.

Add this snippet using a code snippets plugin or your child theme’s functions.php:

add_filter( 'charitable_campaign_post_type', function( $args ) {
    $args['public']              = false;
    $args['publicly_queryable']  = false;
    $args['exclude_from_search'] = true;
    return $args;
} );

After adding the snippet, flush your permalinks: go to Settings > Permalinks in your WordPress admin and click Save Changes. You don’t need to change anything on that screen. The act of saving regenerates the rewrite rules so the campaign URL stops resolving.

What happens to the campaign embed

Both options leave the campaign embed untouched:

  • The [charitable_campaign] shortcode keeps rendering on your donate page.
  • The Charitable campaign block keeps rendering on your donate page.
  • The campaign’s title, story, goal, and donation form all keep loading.
  • New donations still attach to the campaign and update its progress.

The embed reads the campaign post directly by ID, so it doesn’t matter whether the campaign’s own URL is public, redirected, or returning a 404.

Which option should you pick?

Use Option 1 (redirect) if…Use Option 2 (non-public) if…
A campaign URL might already be shared, indexed, or linked from somewhere.The campaign URL has never been shared and isn’t in search results.
You want a graceful handoff for any visitor who finds the old URL.You’d prefer the URL not to resolve at all.
You want search engines to follow the 301 and drop the old URL over time.You don’t care about preserving the URL’s search presence.

In most cases, Option 1 is the safer choice because it handles both new visitors and anyone who already has the URL.

Frequently asked questions

Will this affect how donations are tracked?

No. Donations are attached to the campaign record itself, not the URL. Whether someone donates through your embedded form on /donate/ or (before the redirect) the auto-created campaign page, the donation lands on the same campaign and counts toward the same goal.

Does this remove the campaign from the WordPress admin?

No. The campaign still shows up in Charitable > Campaigns in your admin. You can edit it, archive it, see its donations, and so on. Only the public URL changes.

Can I do this for one campaign but not others?

Yes – narrow the redirect by checking the specific campaign ID:

add_action( 'template_redirect', function() {
    if ( is_singular( 'campaign' ) && get_queried_object_id() === 123 ) {
        wp_safe_redirect( home_url( '/donate/' ), 301 );
        exit;
    }
} );

Replace 123 with the ID of the campaign you want to redirect. Other campaigns will continue to use their normal URLs. (Option 2 is all-or-nothing because it changes the post type registration.)

What about the campaign archive page?

Charitable already has the campaign archive turned off (has_archive => false), so visiting /campaigns/ on its own doesn’t render a Charitable archive. You don’t need to do anything extra to disable it.


Developer reference

The rest of this page is for developers who want more control over the campaign post type registration.

The filter

charitable_campaign_post_type runs on init (priority 5) just before register_post_type() is called. It receives the full arguments array used to register the campaign post type, so you can change any of these:

ArgumentDefaultEffect
publictrueMaster switch for front-end visibility and admin UI.
publicly_queryabletrueWhether /campaigns/[slug]/resolves to a single template.
exclude_from_searchfalseWhether /?s= searches include campaigns.
has_archivefalseThe campaign archive is already off by default.
rewritearray( 'slug' => 'campaigns', 'with_front' => true )The URL slug for single campaigns.
show_in_nav_menustrueWhether campaigns can be added to nav menus from Appearance > Menus.

Changing the URL slug instead of disabling it

If you’d rather keep the single campaign page but change its URL prefix, filter the rewrite slug. For example, to change /campaigns/[slug]/ to /fundraise/[slug]/:

add_filter( 'charitable_campaign_post_type', function( $args ) {
    $args['rewrite']['slug'] = 'fundraise';
    return $args;
} );

Flush permalinks after the change (Settings > Permalinks > Save Changes).

Why with_front matters

The default 'with_front' => true means WordPress prepends your permalink front to the campaign URL. If your WordPress permalink structure is /news/%postname%/, your campaign URLs will be /news/campaigns/[slug]/. Set 'with_front' => false to ignore the permalink front:

add_filter( 'charitable_campaign_post_type', function( $args ) {
    $args['rewrite']['with_front'] = false;
    return $args;
} );

Flush permalinks after the change.

How the embed keeps working

The [charitable_campaign] shortcode and the campaign block both resolve to Charitable_Campaign queries that load the post by ID. Those queries use get_post() and direct meta lookups, which are independent of the public and publicly_queryable flags. The flags only control whether the WordPress front-end controller will route a request to the single campaign template. Disabling them does not block PHP code from reading the post.

Hook reference

HookTypeUse it to
charitable_campaign_post_typeFilterModify the arguments passed to register_post_type() for campaigns. Runs on init priority 5.
template_redirectActionFire your redirect after WordPress has parsed the request and chosen a template, but before the template is loaded. Standard WordPress hook.
is_singular( 'campaign' )ConditionalTrue when the current request is a single campaign URL. Use it inside template_redirect to scope the redirect.

Still have questions? We’re here to help!

Last Modified:

What's New In Charitable

View The Latest Updates
🔔 Subscribe to get our latest updates
📧 Subscribe to Emails

Email Subscription

Join our Newsletter

We won’t spam you. We only send an email when we think it will genuinely help you. Unsubscribe at any time!

ambassadors New

👤 Creator Profiles: Put a Face to Every Peer-to-Peer Campaign

Ambassadors 3.3.0 now provies Creator Profiles — giving your supporters a permanent, shareable public home that turns one-time fundraisers into ongoing relationships.

👤 Public Creator Pages: Give every fundraiser an instant, clean landing page at /creator/their-name/ to showcase their custom avatar, bio, and a browsable grid of their campaigns.

📊 Proof of Impact: Boost donor trust by displaying site-wide milestones on the profile—like total funds raised and total donor counts.

💳 Interactive Hover Cards: When donors hover over a creator’s name on a campaign page, a compact card expands with their bio and social handles right at the moment of decision.

📍 Responsible Location Sharing: Allow creators to safely show local supporters where they are based using only city, state, and country details.

🛠️ Self-Serve Customization: Fundraisers can update their own profiles and link up to six social networks directly from the My Campaigns hub, saving you admin time.

Ready to empower your advocates? Update to Ambassadors 3.3.0 and turn on “Enable Public Creator Page” today!

Improvement Payments

📱 Turn Mobile Scrollers Into Donors: Meet Charitable’s Mollie Upgrade

Losing mobile supporters because they hate typing out long card numbers on their phones? Charitable’s updated Mollie integration features:

⚡ One-Tap Wallet Checkout: Enable donors to complete their gifts instantly using Apple Pay or Google Pay with a simple face scan, fingerprint, or tap.

💰 No Extra PCI Burden: Skip complex domain verification and security compliance since all wallet transactions run safely through Mollie’s hosted checkout.

🛠️ Custom Cancel Routing: Keep the experience predictable by automatically sending donors who back out to your cancellation page, or use developer filters to route them to a custom page.

Visit this page to learn more.

ambassadors improved New

Moderation and Directory Screens In Ambassadors 3.0

Ambassadors 3.0 has new features: moderation and directory screens… now easily see those who are earning donations on your peer to peer network – including campaign creators that might need to be verified – all in one place. Generate reports, email ambassadors and campaign creators directly and more.

🚀 See when campaign creators and ambassadors have updated their campaigns, what donors/donation they have brought in and more.

🎉 Manually add ambassadors and campaign creators, and approve them in one-click!

Visit this page to learn more.

New Payments

⚡ Unlock India-Based Donations: Meet Charitable’s Native Razorpay Integration

Trying to collect donations in India? Charitable’s native Razorpay integration features:

⚡ Instant UPI Integration: Accept fast, local donations directly inside your form via apps like PhonePe, Google Pay, Paytm, and BHIM without sending donors away from your site.

📲 Auto-Generated Campaign QRs: Instantly render scannable QR codes encoding a UPI deep link directly on your public campaign pages and sidebars for an effortless “scan-to-give” experience.

💰 Dual Local & Global Reach: Headline your campaigns in INR while seamlessly accepting major international currencies like USD, EUR, GBP, and CAD to maximize global support.

🔁 Seamless Recurring Giving: Fully integrates with the Charitable Recurring addon to manage automatic monthly subscriptions directly through Razorpay without extra code.

↩️ Automatic Two-Way Sync: Keep your books perfectly clean with two-way refund syncing—issue a refund inside WordPress or your Razorpay dashboard and both sides update automatically.

🔒 Webhook-Verified Security: Automatically protect your donation records using HMAC-signed webhook verification to ensure every status update represents real money cleared on the rails.

Visit this page to learn more.

Integration New

🎉 New Built-in PushEngage Integration

Struggling with falling email open rates and rising ad costs just to keep your supporters engaged? Charitable’s built-in PushEngage integration features:

🔔 Zero-Fee Direct Messaging: Deliver crisp, instant pop-up notifications straight to your donors’ desktops and mobile devices.

⏱️ Four Smart Automated Triggers: Automatically send updates for immediate donation thank yous, full-list campaign launches, urgent “ending soon” alerts, and goal milestone celebrations.

📈 Group Momentum Broadcasts: Turn private milestones into public wins by automatically broadcasting alerts to your entire subscriber list the moment a campaign hits 50%, 75%, or 100% of its goal.

📊 Automatic Analytics Tracking: Monitor exactly where your incoming notification traffic is coming from with built-in attribution that requires zero complex configuration.

Visit this page to learn more.