In this guide, we’ll walk you through how to disable the Astra footer (Above, Primary, or Below) across your entire website using a simple custom code.
While Astra provides Meta Settings to disable the header or footer for individual pages or posts, using a custom filter can be quicker for a site-wide solution.
What Are the Steps to Remove the Astra Footer?
- Open your child theme’s functions.php file.
- Add the following code to remove the entire footer (Above, Primary, and Below):
add_action('wp', 'ast_remove_footer');
function ast_remove_footer() {
remove_action('astra_footer', array(Astra_Builder_Footer::get_instance(), 'footer_markup'));
}
How Can You Remove Specific Footer Sections?
To remove specific sections of the footer, replace the code in the remove_action line as shown below:
Remove only the Above Footer section:
remove_action('astra_above_footer', array(Astra_Builder_Footer::get_instance(), 'above_footer'));
Remove only the Primary Footer section:
remove_action('astra_primary_footer', array(Astra_Builder_Footer::get_instance(), 'primary_footer'));
Remove only the Below Footer section:
remove_action('astra_below_footer', array(Astra_Builder_Footer::get_instance(), 'below_footer'));
Helpful Resources:
If you don’t have a child theme installed, follow this guide: How to Install an Astra Child Theme.
Unsure how to add the code? Check out this guide: [How to Add Custom PHP Code in a Child Theme]
We hope this guide helps you manage your Astra footer more effectively. If you have any questions or need further assistance, feel free to leave a comment below!