# Block Disposable Emails at EDD Checkout

> Rejects purchases made with throwaway email addresses on the Easy Digital Downloads checkout, so download links and receipts reach a real inbox.

- Type: PHP
- Runs: Run everywhere
- Category: [Easy Digital Downloads](https://wpide.com/library/category/edd/)
- Requires: Easy Digital Downloads
- Tags: edd, checkout, email, fraud
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/edd-block-disposable-emails/

## Code

```php
$wpide_edd_disposable = array( 'mailinator.com', 'guerrillamail.com', '10minutemail.com', 'tempmail.com', 'yopmail.com', 'trashmail.com', 'sharklasers.com', 'getnada.com', 'temp-mail.org' );

add_action( 'edd_checkout_error_checks', function ( $valid_data, $post ) use ( $wpide_edd_disposable ) {
    $email = strtolower( (string) ( $post['edd_email'] ?? '' ) );

    if ( is_user_logged_in() && '' === $email ) {
        $email = strtolower( wp_get_current_user()->user_email );
    }

    $domain = false !== strpos( $email, '@' ) ? substr( strrchr( $email, '@' ), 1 ) : '';

    foreach ( $wpide_edd_disposable as $blocked ) {
        if ( $domain && ( $domain === $blocked || substr( $domain, -strlen( '.' . $blocked ) ) === '.' . $blocked ) ) {
            edd_set_error( 'wpide_disposable_email', 'Please use a permanent email address so we can send your downloads.' );
            return;
        }
    }
}, 10, 2 );
```

## Notes

Add domains to the list as you spot them; subdomains of listed domains are blocked too.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Block Disposable Emails at EDD Checkout" 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/
