# Different Success Page per EDD Download

> Sends buyers of specific downloads to their own thank-you page after purchase, for example with setup instructions or an onboarding video.

- Type: PHP
- Runs: Run everywhere
- Category: [Easy Digital Downloads](https://wpide.com/library/category/edd/)
- Requires: Easy Digital Downloads
- Tags: edd, checkout, redirects, thank-you
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/edd-success-page-per-download/

## Code

```php
$wpide_edd_success_pages = array( // Download ID => page ID.
    101 => 202,
);

add_filter( 'edd_success_page_redirect', function ( $redirect, $gateway, $query_string ) use ( $wpide_edd_success_pages ) {
    $session = function_exists( 'edd_get_purchase_session' ) ? edd_get_purchase_session() : false;

    foreach ( (array) ( $session['downloads'] ?? array() ) as $download ) {
        $page = $wpide_edd_success_pages[ (int) ( $download['id'] ?? 0 ) ] ?? 0;

        if ( $page && 'publish' === get_post_status( $page ) ) {
            return get_permalink( $page ) . $query_string;
        }
    }

    return $redirect;
}, 10, 3 );
```

## Notes

The first matching download wins; add the [edd_receipt] shortcode to those pages to keep showing the receipt.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Different Success Page per EDD Download" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
