HomeTips & Tricks How to Remove Top Margin from any WordPress Website

How to Remove Top Margin from any WordPress Website

When you are using wp_head() function in header.php at the end of the section. After using it automatically CSS apply margin-top 28px or margin-top 32px or something else. in the WordPress Public Website there is a very big unnecessary space from the top bar which looks is very bad and dirty for site viewer, So how to remove that margin top. It’s very easy you have to add the following code into function.php file.

#Remove Top Margin
function remove_admin_login_header() {
remove_action(‘wp_head’, ‘_admin_bar_bump_cb’);
}
add_action(‘get_header’, ‘remove_admin_login_header’);

Login to your WordPress Dashboard with your WP username and password or go to the functions file inside your current theme folder from root directory and paste the above given code inside functions.php file and save the work.

how to delete margin-top 32px important from WordPress
how to remove margin-top 32px important from WordPress.

Now finally removed top margin from your public website, So if you have any confusion on this article please comment us.

In the end

I hope you have found this article helpful. Let us me your opinion or questions if any through the comment form in below or use this form to ask your question.

You May Also Like

About the Author: Kedar Adhikari

I am WordPress Themes developer and designer and also any type of website design with minimum cost. for more information you can contact me on email gojinepal@gmail.com

Leave a Reply

Your email address will not be published. Required fields are marked *

Copyright © 2020 My WP Helper. All rights reserved.