Documentación de Charitable

Aprende a sacar el máximo partido a Charitable con instrucciones claras y paso a paso.

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:

ArgumentPredeterminadoEfecto
publicverdaderoMaster switch for front-end visibility and admin UI.
publicly_queryableverdaderoWhether /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_menusverdaderoWhether 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

HookTipoUse it to
charitable_campaign_post_typeFiltroModify the arguments passed to register_post_type() for campaigns. Runs on init priority 5.
template_redirectAcciónFire 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.

¿Todavía tienes preguntas? ¡Estamos aquí para ayudarte!

Última modificación:

Novedades en Benéfico

Ver las últimas actualizaciones
🔔 Suscríbete para recibir nuestras últimas actualizaciones
📧 Suscribirse a correos electrónicos

Suscripción por correo electrónico

Únete a nuestro boletín

No te enviaremos spam. Solo enviamos un correo electrónico cuando creemos que realmente te ayudará. ¡Date de baja en cualquier momento!

GiveWP Migraciones Nuevo

Servicio de Migración "White Glove" para GiveWP

¿Estás pensando en cambiar tu plataforma de recaudación de fondos de GiveWP a Charitable, pero no quieres arriesgarte a perder tus datos ni a encargarte tú mismo de una configuración técnica compleja? El Servicio de Migración "White Glove" de Charitable incluye:

👥 Mapeo impecable de donantes: Transfiere de forma segura toda tu base de datos de colaboradores sin pérdida de datos.

📊 Historial financiero completo: Conserva meticulosamente cada transacción histórica para una presentación de informes continua y precisa.

🔄 Donaciones recurrentes sin interrupciones: Transfiere de forma segura las suscripciones activas sin interrumpir tus ingresos ni requerir que tus donantes actualicen su información.

💳 Cero interrupciones en la pasarela de pago: Sigue usando Stripe, PayPal o cualquier otro procesador compatible con GiveWP que ya te guste.

🚀 Configuración técnica experta: Relájate mientras nuestro equipo se encarga de la instalación y configuración de tus formularios. Además, los usuarios que cumplan los requisitos obtendrán un año completo de Charitable Pro gratis.

Visita esta página para obtener más información.

automatización Mejora

📢 Alerta de nueva función: ¡Automation Connect 2.0 ya está aquí! 🚀

¿Estás pensando en conectar tus datos de recaudación de fondos con herramientas como Mailchimp, Slack o Google Sheets, pero no quieres contratar a un desarrollador ni escribir código personalizado? El nuevo complemento de automatización de Charitable incluye:

⚡ 17 disparadores de eventos: Activa instantáneamente webhooks para el primer donativo de un donante, pagos de renovación o hitos de campaña alcanzados.

🎯 Lógica condicional inteligente: Utiliza una potente lógica AND/OR en 11 campos para enviar datos solo cuando cumplan tus criterios exactos, como las suscripciones al boletín.

📊 Control de carga útil personalizado: Selecciona entre más de 80 campos de datos limpios de metadatos de donantes, donaciones y campañas para que tus aplicaciones obtengan exactamente lo que necesitan.

🚀 Plantillas de plataforma preconstruidas: Evita la configuración desde cero con plantillas listas para usar para Zapier, Make.com, n8n, HubSpot y Slack.

🛡️ Herramientas de desarrollador fiables: Potencia tus flujos de trabajo con cargas útiles firmadas HMAC-SHA256, filtros completos de WordPress y registros de reintentos automáticos.

automatización Mejora

🔌 Charitable se une a Zapier: Conecta con más de 7000 aplicaciones y automatiza tu recaudación de fondos

¿Cansado de copiar manualmente los datos de las donaciones en hojas de contabilidad o de rastrear las nuevas suscripciones de donantes? Pon tus tareas administrativas en piloto automático. Charitable ya está oficialmente en Zapier, lo que te proporciona una forma potente y sin código para conectar tu recaudación de fondos directamente con el resto de tus herramientas favoritas.

Cada donación, suscripción de donante e hito de campaña ahora puede activar un flujo de trabajo automatizado sin problemas.

Novedades:

♾️ Conecta con más de 7000 aplicaciones: Une tus campañas de Charitable con software cotidiano como Google Sheets, QuickBooks, Slack, Mailchimp, HubSpot, Notion, Airtable y miles más.

⚡ 12 potentes disparadores: Crea flujos de trabajo profundos utilizando disparadores de automatización inteligentes que cubren todo el ciclo de vida de la donación, incluyendo Nueva Donación, Nuevo Donante, Suscripción Cancelada y Objetivo de Campaña Alcanzado.

📋 Plantillas de acciones preconstruidas: Empieza en tres minutos o menos con nuestras combinaciones de plantillas prefabricadas, como registrar automáticamente nuevas donaciones directamente en una Hoja de Cálculo de Google o enviar correos electrónicos personalizados de bienvenida a donantes a través de Gmail.

🚫 No se necesita código: No se requieren webhooks complejos ni scripts PHP personalizados. Simplemente elige tu disparador, selecciona tu aplicación, mapea tus campos y deja que Zapier se encargue del trabajo pesado.

¿Listo para ahorrar horas de tiempo administrativo? ¡Consigue Charitable Pro con el complemento Automation Connect hoy mismo y lanza tu primer Zap!

Mejora Pagos

🚀 Presentamos PayPal Commerce: Una conexión, seis formas de donar

Los donantes esperan opciones de pago modernas y flexibles cuando apoyan una causa. Si no ven su método preferido en su formulario de donación, a menudo desaparecen sin decir nada. Con PayPal Commerce, estamos brindando una experiencia de pago completamente modernizada directamente a sus campañas.

Disfrute de una única integración que mejora sus formularios, hace que las donaciones sean fluidas y le ayuda a capturar cada donación.

Novedades:

🔌 Conexión con un clic: omita las complicadas claves API y los documentos para desarrolladores. Simplemente haga clic en "Conectar con PayPal", inicie sesión en su cuenta comercial y su formulario moderno estará activo en menos de cinco minutos.

💳 Seis formas de donar: brinde a sus seguidores acceso instantáneo al saldo de PayPal, Venmo (EE. UU.), financiación "Paga más tarde", las principales tarjetas de crédito/débito, Apple Pay (Safari) y Google Pay (Chrome), todo desde el mismo formulario.

🔄 Donaciones recurrentes flexibles: admite completamente las donaciones mensuales. Elija entre la API de suscripciones de PayPal (gestionada automáticamente por PayPal) o Vault + Cron (gestionada de forma segura en su sitio).

💬 Recuperación de errores amigable: no más alertas confusas del navegador. Si se rechaza un pago, los donantes ven mensajes sencillos y en línea que los guían sobre cómo solucionar el problema y completar su donación.

¿Listo para PayPal, modernizado? Actualice a Charitable Pro 1.8.15+ (o Charitable Lite 1.8.11+) y conecte su cuenta hoy mismo.

Campañas Nuevo

⏳ Cuenta atrás de la campaña: genere urgencia y aumente las donaciones

¡La urgencia es una de las herramientas más poderosas en la recaudación de fondos! Conozca Campaign Countdown, un temporizador en vivo y en tiempo real diseñado para convertir la procrastinación en generosidad inmediata.

animación de cuenta atrás de campaña

Novedades:

⏱️ Urgencia en vivo y en tiempo real: rastree bellamente días, horas, minutos y segundos hasta la fecha límite de su campaña con cuentas atrás visuales que se actualizan en vivo.

🎨 Adaptado a su estilo: elija entre mosaicos con borde "Boxed" o una pantalla "Inline" limpia y de una sola línea. Adapte su tema al instante con controles de fuente y color profundo.

🛠️ Colóquelo en cualquier lugar: inserte la cuenta atrás donde desee utilizando el campo Campaign Builder, un bloque Gutenberg dedicado o un simple shortcode.

🚨 Acciones inteligentes de caducidad: control total sobre el estado final: elija reemplazar automáticamente el temporizador con un mensaje personalizado, congelarlo en cero y más.