How to insert adsense code in wordpress blog using cpanel or hpanel

Started by certforumz, April 11, 2025, 11:09:08 AM

Previous topic - Next topic

certforumz

To insert Google AdSense code into a WordPress site using cPanel, you'll first need to sign up for a Google AdSense account and obtain the necessary code snippet. Then, you can either use a plugin to insert the code into your site's header or manually edit your theme's header file using cPanel's file manager. After inserting the code, you'll need to verify it with AdSense and wait for Google to review your site.
Steps to Insert AdSense Code into WordPress using cPanel:
1. Sign Up for Google AdSense:
Go to the Google AdSense website and create an account.
Fill out the required information and agree to the terms and conditions.
Connect your website to your AdSense account.
2. Get the AdSense Code:
Once your site is connected, AdSense will provide you with a code snippet to paste into your website.
Do not click "Done" or close the page while you are getting the code.
3. Access cPanel:
Log in to your cPanel account for your WordPress website.
4. Edit the Theme Header (Using cPanel File Manager):
Find the File Manager or similar tool in cPanel.
Navigate to your WordPress installation directory.
Locate the "wp-content" folder and then the "themes" folder.
Open the folder of your current WordPress theme.
Find the "header.php" file.
Open the "header.php" file in the editor.
5. Insert the AdSense Code:
Paste the AdSense code snippet you obtained earlier into the header.php file.
Typically, you'll paste it just before the closing </head> tag.
6. Save the Changes:
Save the changes to the header.php file.
7. Verify the Code in AdSense:
Return to your AdSense account and follow the prompts to verify that you have placed the code on your site.
Check the box indicating that you have pasted the code.
Click "Done".
8. Request Site Review:
Google will review your site to ensure it meets their requirements for AdSense.
You may need to wait a few days or weeks for the review process to complete.
9. (Optional) Use a Plugin:
You can also use a plugin like Site Kit by Google to simplify the process of adding AdSense code.
Install and activate the plugin, and then follow the prompts to connect your AdSense account.