input license here

SEO smart link: Liên kết thông minh trên blogspot

Liên kết thông minh này phục vụ thay đổi mọi từ khóa hoặc một từ khóa trên blog của bạn thành một liên kết, cả trong bài đăng và trên trang blog.

SEO smart link: Liên kết thông minh trên blogspot

Nói nôm na cho các bạn dễ hiểu là khi các bạn cài đặt sẵn những từ khóa smart link này rồi thì khi bài viết của các bạn có những từ đã thiết lập sẵn đó nó sẽ tự động chuyển thành link liên kết (nhìn code phía dưới sẽ hiểu)

Ví dụ: Khi bạn cài sẵn smart link SEO cho từ khóa "Blogger" chẳng hạn thì tất cả các bài viết trên blog hay trên trang của bạn mà có từ "Blogger" nó sẽ tự động chuyển thành link liên kết hết.

Hướng dẫn cài đặt smart link SEO

Các bạn chèn đoạn Js sau vào trên thẻ /body
<!--LK thông minh-->
<script type='text/javascript'>
function smartLink(){
    this.keywdHref = new Object();
    this.add = function(keyword, href){
        if(keyword.substr(0,1) != &quot; &quot;){keyword = &quot; &quot; + keyword;}
        this.keywdHref[keyword] =  href;
    }
    this.createAnchor = function(){
        var objs = document.getElementsByTagName(&quot;div&quot;);
        for(var i=0; i&lt;objs.length; i++){
            var obj = objs[i];
            if(obj.className.indexOf(&quot;post-body&quot;)&gt;-1){
                var content = obj.innerHTML;
                for(var keyword in this.keywdHref){
                    var href = this.keywdHref[keyword];
                    var newstr = content.replace(keyword, &quot;&lt;a href=&#39;&quot;+href+&quot;&#39;&gt;&quot;+keyword+&quot;&lt;/a&gt;&quot;, &quot;gi&quot;);
                    obj.innerHTML = newstr;
                    content = newstr;
                }
            }
        }
    }
    this.startScript = function(){
        var onLoad = window.onload;
        window.onload = function(){
            if(onLoad){onLoad();}
            setTimeout(&quot;f.createAnchor()&quot;, 100);
        }
    }
}
</script>
<script type='text/javascript'>
var f = new smartLink();
f.add(&quot;SEO&quot;, &quot;https://www.insurancefinances.com/search/label/seo-friendly&quot;);
f.add(&quot;Blogger&quot;, &quot;https://www.insurancefinances.com/search/label/thu-thaut-blogspot&quot;);
f.add(&quot;Blogspot&quot;, &quot;https://www.insurancefinances.com/search/label/thu-thaut-blogspot&quot;);
f.add(&quot;Template&quot;, &quot;https://www.insurancefinances.com/search/label/template-blogspot&quot;);
f.add(&quot;kiếm tiền&quot;, &quot;https://www.insurancefinances.com/search/label/mmo&quot;);
f.add(&quot;font&quot;, &quot;https://www.insurancefinances.com/search/label/font-free&quot;);
f.add(&quot;adsense&quot;, &quot;https://www.niemstyle.com/search/label/google-adsense&quot;);
f.startScript();
</script>
Trong đoạn js trên, các bạn chú ý phần code ở cuối là những từ khóa mình đang sử dụng, các bạn lướt blog mình mà thấy mấy từ đó là có link hết, kể cả ngoài blog lẫn trong bài viết.

Các bạn cũng có thể làm in đậm hoặc in nghiêng từ khóa như sau:
f.add(&quot;&lt;b&gt;SEO&lt;/b&gt;&quot;, &quot;https://www.insurancefinances.com/&quot;);
f.add(&quot;&lt;i&gt;SEO&lt;/i&gt;&quot;, &quot;https://www.insurancefinances.com/&quot;);
và thêm nhiều từ khóa cũng được.

Lưu ý

Mặc dù một bài đăng trên blog có nhiều từ khóa được nhắm mục tiêu, smart link này sẽ chỉ thay đổi từ khóa thành một liên kết ở trên cùng hoặc từ khóa đầu tiên, vì vậy từ khóa tiếp theo sẽ vẫn là văn bản bình thường.

Nếu bạn muốn kích hoạt nó chỉ trong các bài viết trên blog, bạn có thể thêm một mã thẻ có điều kiện vào mã javascript ở trên.

Kết luận

SEO smart link này hoàn hảo cho những ai muốn xây dựng một liên kết nội bộ với các từ khóa được nhắm mục tiêu, vì vậy việc thiết lập nó dễ dàng hơn vì tất cả từ khóa được nhắm mục tiêu sẽ tự động trở thành liên kết.
Related Posts
Diệp Quân
Nguyen Manh Cuong is the author and founder of the vmwareplayerfree blog. With over 14 years of experience in Online Marketing, he now runs a number of successful websites, and occasionally shares his experience & knowledge on this blog.
SHARE

Related Posts

Subscribe to get free updates

Post a Comment

Sticky