How To Create AdSense Ads Custom Shortcodes in WordPress

Subscribe our YouTube Channel    

How To Create AdSense Ads Custom Shortcodes in WordPress | Hello dosto aapka swagat hai aajke yah fresh article mai, aaj mai aapko sikhaunga ki kis tarah se aap adsense ads ka custom shortcode bana sakte hai wordpress mai.

#01 Step

Nice jo code hai esko copy kijiye or aapke wordpress website ki function.php file mai paste kar dijiye.


function ads_shortcode() {
    return 'YOUR-ADSENSE-CODE-HERE';
}
add_shortcode('ads', 'ads_shortcode');

#02 Step

Code Paste karne ke bad aapko nice jo code hai es tarah se aapka adsense ka ads unit add karna hai, aap yaha par display ads, in article, links ads sabhi tarah ki ads laga sakte hai.

Ab aapko jitne ads unit ka shortcode banana hai etni bar es code ko copy karke paste kar dijiye or jo add shortcode ke andar ads likha hai waha aapko number ad karne hai like ads1, ads2 aise.

Jaise ki yaha maine ek in article ads ka shortcode banaya hai “ads” to aapko jite ads sahiye etne shortcode bana sakte hai.


function ads_shortcode() {
    return '<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle"
     style="display:block; text-align:center;"
     data-ad-layout="in-article"
     data-ad-format="fluid"
     data-ad-client="ca-pub-xxxxxxxxxxxxxxxx"
     data-ad-slot="xxxxxxxxx"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>';
}
add_shortcode('ads', 'ads_shortcode');

#03 Step

Ab bat karte hai aapko ads show kis tarah se karni hai ,to simple aapko jaha jaha ads show karni like post mai page mai to aapko simple [ads] likhna hai yaha ads hamara shortcode hai.


[ads1]

Final Word

To doston mai finaly aasha rakhta hu ki aapko yah article pasand aaya hoga, agar aaya to der kis bat ki share kardijiye taki aapke friend bhi kuch naya jane.

Agar aapko yah article pasand aaya to share jarur kijiyega sabhi social media me, or ha ek request hai hamare youtube channel ko jarur Subscribe karna ,aap hume sabhi social media pe bhi follow karlijiye jaise ki, Facebook, Twitter, Instagram, YouTube.

Share Share on Facebook Share on Twitter Share on LinkedIn Pin on Pinterest Share on Stumbleupon Share on Tumblr Share on Reddit Share on Diggit

Bharat Makwana is a Founder & Owner of Veewom. He is Content creator and Web Developer from past three years. He loves to read and get in touch with the latest technology, he also have YouTube Channel BMTechTips ,for more info contact - hi@bharatmakwana.com.

You may also like this!