I uploaded the pages including my header.php to wordpress and my header have auto generated   in it together with #text.
I tried adding this code but nothing happens.
remove_filter( 'the_content', 'wpautop' );
remove_filter( 'the_excerpt', 'wpautop' );
Are there any solutions for this?
Edit:
This is where " " shows up:
https://i.stack.imgur.com/yvQgI.jpg
So your theme is outputting
 in the "nav menu items". So try to use the following code, see if it removes those extra spaces!Code goes into your
functions.phpfile of your theme.