# "Free" Label and Button for Free Downloads

> Shows "Free" instead of 0.00 for free downloads and changes their purchase button to "Download for free", so visitors see at a glance they pay nothing.

- Type: PHP
- Runs: Run everywhere
- Category: [Easy Digital Downloads](https://wpide.com/library/category/edd/)
- Requires: Easy Digital Downloads
- Tags: edd, free-downloads, buttons, prices
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/edd-free-download-labels/

## Code

```php
$wpide_edd_free = array(
    'price'  => 'Free',
    'button' => 'Download for free',
);

add_filter( 'edd_download_price_after_html', function ( $formatted, $download_id, $price ) use ( $wpide_edd_free ) {
    return ( 0.0 === (float) $price && function_exists( 'edd_has_variable_prices' ) && ! edd_has_variable_prices( $download_id ) ) ? '<span class="edd_price wpide-edd-free">' . esc_html( $wpide_edd_free['price'] ) . '</span>' : $formatted;
}, 10, 3 );

add_filter( 'edd_purchase_link_args', function ( $args ) use ( $wpide_edd_free ) {
    if ( ! empty( $args['download_id'] ) && function_exists( 'edd_is_free_download' ) && edd_is_free_download( $args['download_id'] ) ) {
        $args['text'] = $wpide_edd_free['button'];
    }

    return $args;
} );
```

## Notes

Edit the two texts at the top; paid downloads are not affected.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find ""Free" Label and Button for Free Downloads" 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/
