WP SITES

2952 Tutorials & 191 Plugins

Custom Button Link Per Product in WooCommerce

This PHP code enables you to add a custom button on your single product page with a custom link. You can add the link using WordPress custom fields or a custom field plugin like ACF.

  • Key used for WP custom fields is wp_button.
  • For ACF, use acf_button.

If ACF not active, WP custom fields will be used.

The code enables you to open the link in the same window or new window and add the nofollow attribute to the link on a per product basis.

Use this file to import the ACF settings.

Works in any WordPress theme running WooCommerce.

Was This Tutorial Helpful?