• I have a website. I tried adding google AdSense code in the header using the header and footer plugin. but 3 times I got a response to add code in the header. how can I solve this issue?

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    There are a number of plugins that can do this: https://wordpress.org/plugins/search/adsense

    As an alternative to using a plugin, you could add the code to the header.php file.

    You’ll want to put it in the head section of the HTML, as shown here:
    https://support.google.com/adsense/answer/9274516

    To find and edit the header.php file, you can open it from your FTP access, if you have that. If not, you could find it in your cPanel’s file browser, if you have that. It will be in a folder called “wp-content”, then the folder for your theme.

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    Editing a theme’s header.php file is a bad idea. Any changes will be lost when you update the theme. It’s best to use code to add to the header via the appropriate function calls or use a plugin.

    Depends on the type of theme you’re using. If it’s a theme that you’ve developed in-house that’s not getting updates from a third party, you can edit all of your files as you need.

    If it is a theme where you’ll be getting updates from elsewhere, you certainly can use a plugin instead, or create a child theme to make edits to the files. These are just options to consider based on your situation.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘how can i add adsense script?’ is closed to new replies.