my header.php page got erased when i trying to post google tag manger code , how can i retrieve it, rest of the theme is ok

When i was trying to paste my google tag code into header.php page , the entire page got erased, how can i retrive it.

I am able to the see the sliders in the header area , but the header page is missing in which the display happens. need a immediate solution to retrive it.

Topic wp-blog-header.php Wordpress

Category Web


If it's a prebuilt theme (i.e. you downloaded it from WordPress.org or bought it somewhere), go to the author's website and download a fresh copy. If it's a custom theme, you'll need to rely on your own backups - perhaps you're auto backing up to a Dropbox, or you're using a host that provides file backups.

In either case, if you've only modified header.php, you can FTP in, delete the file, and upload just the header.php from your backup source.

Also in either case, it's never a good idea to use the "edit files" option in wp-admin, or to modify a theme. It's safest to create a child theme and upload it via FTP. That way you're adding new files, not modifying old ones, and as the parent theme gets updated your overrides like GTM will stay in place.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.