Home » WooCommerce: Rename Downloads Table Column Title @ My Account

WooCommerce: Rename Downloads Table Column Title @ My Account

by Tutor Aspire

The WooCommerce My Account > Downloads endpoint features a table which lists the available downloads. This table has 4 default columns: Product, Downloads remaining, Expires, Download (as you can see from the screenshot below).

Now, it’s very likely you may want to rename these headings into something more readable or understandable. On top of that, you may want to change the content of whatever column – you’ll find a workaround for this as well. Enjoy!

Here’s how to rename any WooCommerce My Account Downloads table header

PHP Snippet: Rename Downloads Table Headers @ WooCommerce My Account

/**
 * @snippet       Rename Downloads Table Header @ WooCommerce My Account
 * @how-to        Get tutoraspire.com FREE
 * @author        Tutor Aspire
 * @compatible    WooCommerce 6
 * @donate $9     https://www.tutoraspire.com
 */

add_filter( 'woocommerce_account_downloads_columns', 'tutoraspire_rename_downloads_page_columns' );

function tutoraspire_rename_downloads_page_columns( $cols ) {
$cols['download-remaining'] = 'New Title';
return $cols;
}

You can also rename ‘download-product’, ‘download-expires‘ and ‘download-file‘ array values.

Bonus PHP Snippet: Custom Downloads Table Content @ WooCommerce My Account

On top of editing the table headers, you can also print whatever you want inside one of the 4 columns. All you need to remember are the 4 column IDs: ‘download-product’, ‘download-remaining‘, ‘download-expires‘ and ‘download-file‘ as the WooCommerce action hook has the following format: ‘woocommerce_account_downloads_column_COLUMNID‘ e.g. ‘woocommerce_account_downloads_column_download-remaining

/**
 * @snippet       Downloads Table Column Content @ WooCommerce My Account
 * @how-to        Get tutoraspire.com FREE
 * @author        Tutor Aspire
 * @compatible    WooCommerce 6
 * @donate $9     https://www.tutoraspire.com
 */

add_action( 'woocommerce_account_downloads_column_download-remaining', 'tutoraspire_ex_downloads_remaining_column_content' );

function tutoraspire_ex_downloads_remaining_column_content( $download ) {
echo 'Test';
}

You may also like