• KodeRian
    KodeRian — A place to share tips, tricks, SEO insights, coding guides, and Blogger tutorials covering HTML, CSS, JavaScript, and AdSense.

    How to Add Auto Source Link in Blogger (Protect Content & Gain Backlinks)

    Learn how to add an automatic source link in Blogger. Protect your content and gain backlinks when others copy your blog text.
    How to Add Auto Source Link in Blogger (Protect Content & Gain Backlinks)

    One of the biggest challenges for bloggers today is content theft. You spend hours writing a well-structured article, only for someone to copy-paste it onto their own site without credit. Not only is this frustrating, but it can also hurt your blog’s SEO if duplicate content spreads without backlinks pointing back to you.

    Fortunately, there’s a smart solution: you can use a simple auto source link script in Blogger. With this method, whenever someone copies text from your blog, a “Source: YourBlogURL” line will automatically be added to their clipboard. This ensures that, whether they paste it into social media, forums, or even another website, your blog’s link is embedded as credit.

    In this tutorial, I’ll show you step by step how to add automatic source links in Blogger. By the end, your blog will have an extra layer of protection and a clever way to gain backlinks.

    Why Add an Automatic Source Link to Blogger?

    Before jumping into the code, let’s explore why this feature is so useful:

    • Protects your content: Copy-pasters won’t be able to share your text without also including a link back to your blog.
    • Generates backlinks: Every time your content is copied, it can potentially create an SEO-boosting backlink.
    • Raises awareness: Even if someone shares your content in a chat or forum, readers will see the original source.
    • Easy to implement: The script is lightweight and won’t slow down your blog.

    Step-by-Step Guide: Add Auto Source Link in Blogger

    Step 1: Open Blogger Theme Editor

    1. Log in to your Blogger Dashboard.
    2. Go to ThemeEdit HTML.

    Step 2: Insert the Script

    Scroll down to the bottom of your theme code and find the closing </body> tag. Just before it, paste the following script:

    <script type='text/javascript'>
    //<![CDATA[
    function copaslink(){
      var body=document.getElementsByTagName("body")[0];
      var selection=window.getSelection();
      var pagelink="<br/><br/>Source: <a href='"+document.location.href+"'>"+document.location.href+"</a><br/>";
      var copytext=selection + pagelink;
      var newdiv=document.createElement("div");
      newdiv.style.position="absolute";
      newdiv.style.left="-99999px";
      body.appendChild(newdiv);
      newdiv.innerHTML=copytext;
      selection.selectAllChildren(newdiv);
      window.setTimeout(function(){ body.removeChild(newdiv); },0);
    }
    document.oncopy=copaslink;
    //]]>
    </script>
    

    Step 3: Save Your Theme

    Click Save. Now try copying some text from your blog and pasting it into Notepad or Word—you should see your article text plus a source link automatically included.

    How It Works

    This script hijacks the oncopy event. Normally, when someone selects text and copies it, only the highlighted content goes to their clipboard. With this code, Blogger adds a custom message and your blog URL after the copied text. It does this by temporarily inserting a hidden <div> into the DOM, replacing the clipboard contents, and then removing it immediately.

    Customization Ideas

    You don’t have to stick with the default “Source:” message. You can modify the script to fit your style:

    • Change label text: Replace Source: with Credit:, Originally posted on:, or Read more at:.
    • Add branding: Include your blog’s name or tagline in the message.
    • Shorten the link: Use a branded short URL if you prefer.
    • Only apply to posts: With a little tweaking, you can restrict this script so it only runs on article pages, not the homepage.

    Extra Tips

    1. Test on different browsers: Make sure the script works in Chrome, Firefox, Safari, and Edge.
    2. Respect usability: Some readers dislike forced credit when copying short quotes. Consider customizing the script for longer selections only.
    3. Combine with a copyright notice: Add a footer note reminding readers about your content rights.
    4. Monitor backlinks: Use tools like Google Search Console to track new backlinks generated by this technique.

    Troubleshooting

    The source link doesn’t appear when I copy text

    Double-check that the script is placed just before </body>. If it’s inside the wrong section, it won’t run.

    It works on desktop but not on mobile

    Some mobile browsers handle the copy event differently. Test on Android and iOS—results may vary depending on browser support.

    The formatting looks strange

    Adjust the line breaks in the script (<br/>) to make the pasted content cleaner.

    It interferes with other scripts

    If you already use other oncopy scripts, merge them carefully or assign unique functions to avoid conflicts.

    Frequently Asked Questions (FAQ)

    Will this stop people from stealing my content?

    No script can fully stop plagiarism. But this feature makes it harder for people to copy without leaving a trace, and it ensures more credit comes back to you.

    Does this improve SEO?

    Indirectly, yes. If people paste your content elsewhere, your blog link is included, which can create valuable backlinks.

    Will this slow down my blog?

    No. The script is lightweight and executes only when someone copies text, so it won’t affect loading speed.

    Can I disable it for specific sections?

    Yes, with a little extra coding, you can exclude widgets like comments or sidebars from triggering the auto source link.

    Conclusion

    Adding an automatic source link script in Blogger is a clever way to protect your hard work and gain backlinks whenever your content is copied. While it doesn’t completely prevent plagiarism, it ensures that anyone who shares your text carries your blog’s credit with them. This is especially useful for tutorial blogs, news sites, or any niche where copying is common.

    If you’re serious about protecting your blog and boosting SEO, take a few minutes to implement this feature today.

    Don’t forget: Bookmark this tutorial, share it with your fellow bloggers, and subscribe for more useful Blogger tips and SEO tricks!

    2 comments

    Comment Guidelines

    Please keep your comments relevant to the topic (Blogger, SEO, coding, etc.).

    Be respectful — no spam, offensive language, or personal attacks.

    You may share suggestions, bug reports, or tutorial requests.

    External links are allowed only if they are truly helpful and not for promotion.

    Feedback will be reviewed, and I will try to reply as soon as possible.

    By commenting here, you help improve KodeRian and keep the discussion useful for everyone.
    1. wah ternyata ini caranya yang sering dipasang di situs berita biar pas kita copy paste muncul link sumbernya
      terimakasih banyak gan wajib pakai nih hehe

      ReplyDelete
      Replies
      1. sama sama, wajib dipakai donks biar ga dicops heeh

        Delete