Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPB Kupası
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

WordPress’te Üstbilgi ve Altbilgi Kodu Nasıl Eklenir (Kolay Yol)

Editoryal Not: WPBeginner üzerindeki ortak bağlantılardan komisyon kazanıyoruz. Komisyonlar, editörlerimizin görüşlerini veya değerlendirmelerini etkilemez. Editoryal Süreç hakkında daha fazla bilgi edinin.

Hiç WordPress web sitenizin <header> veya <footer> bölümüne bazı kod parçacıkları eklemeniz istendi mi?

Google Analytics, Google Search Console, Facebook Pixel ve daha fazlası gibi web hizmetleriyle entegre olmaya çalışırken genellikle WordPress’te üstbilgi ve altbilgi kodu eklemeniz istenir.

WordPress üstbilgi veya altbilginize bazı özel CSS veya JavaScript kodları eklemenizi isteyebilecek WordPress eğitimleriyle de karşılaşabilirsiniz.

WordPress varsayılan olarak web sitenizin üstbilgi ve altbilgisine kod eklemek için bir seçenek sunmaz. Neyse ki, yeni başlayanlar için kolay bir çözüm var.

Bu makalede, WordPress’te üstbilgi ve altbilgi kodlarını nasıl kolayca ekleyebileceğinizi göstereceğiz. Amaç, WordPress tema dosyalarınızı doğrudan düzenlemeden kodu güvenli bir şekilde eklemektir.

How to Add Header and Footer Code in WordPress

WordPress Üstbilgi ve Altbilgi Kodu Eklemenin En İyi Yolu

WordPress üstbilgi ve altbilgi kodu eklemek istiyorsanız, üç olası çözüm vardır:

  1. Temanızın header.php ve footer.php dosyalarını düzenleyerek manuel olarak
  2. Temanızın yerleşik üstbilgi ve altbilgi kodu özelliği ile
  3. WordPress eklentisi kullanma

İlk seçenek acemi dostu değildir çünkü header.php ve footer.php dosyalarını doğrudan manuel olarak düzenleyerek üstbilgi ve altbilgi kodu eklemenizi gerektirir.

Bu yöntemi kullanmanın bir diğer dezavantajı ise temanıza bir güncelleme yüklediğinizde kodunuzun kaldırılacak olmasıdır.

İkinci seçenek ise temanızın yerleşik özelliğini kullanmaktır. Elegant Themes ve StudioPress’in Genesis Framework ‘ü gibi bazı WordPress temaları, WordPress üstbilgi ve altbilginize hızlı bir şekilde kod ve komut dosyası eklemek için yerleşik bir seçenek sunar.

Yerleşik özelliği olan bir tema kullanıyorsanız, bu güvenli ve basit bir çözüm gibi görünür. Ancak, temanızı değiştirirseniz, web sitenize eklenen tüm kod parçacıkları kaybolacaktır. Buna Google Search Console‘da site doğrulaması, Google Analytics aracılığıyla web sitesi analizi vb. dahildir.

Bu nedenle kullanıcılara her zaman üçüncü seçenek olan üstbilgi ve altbilgi eklentisini kullanmalarını öneriyoruz. Bu seçenek, WordPress’te üstbilgi ve altbilgi kodu eklemek için açık ara en kolay ve en güvenli yöntemdir.

Okuyucularımızdan gelen çok sayıda talep üzerine ekibimiz WPCode eklentisini geliştirdi.

WPCode

WPCode (eski adıyla Insert Headers and Footers) %100 ücretsiz bir kod parçacığı eklentisidir. WordPress’te üstbilgi ve altbilgiye kolayca kod eklemek için kullanabilirsiniz.

İşte WPCode eklentisini kullanmanın bazı avantajları:

1. Kolay, Hızlı ve Düzenli: Sitenizin üstbilgi ve altbilgisine kolay ve hızlı bir şekilde kod eklemenizi sağlar. Ayrıca, tüm altbilgi ve üstbilgi kodlarınızı tek bir yerde saklamanıza izin vererek sizi düzenli tutar.

2. Hataları Önler: Akıllı kod parçacığı doğrulaması, tema dosyalarınızı manuel olarak düzenlerseniz oluşabilecek hataları önlemeye yardımcı olur.

3. Endişelenmeden Temanızı Yükseltin veya Değiştirin: Eklenti, üstbilgi ve altbilgi kodunuzu ayrı bir yere kaydeder, böylece kodun silinmesinden endişe etmeden temanızı güncelleyebilir veya değiştirebilirsiniz.

Üstbilgi ve altbilgi komut dosyalarının yanı sıra, tema dosyalarınızı düzenlemeden özel PHP, JavaScript, CSS, HTML ve metin kodu parçacıklarını kolayca eklemek için WPCode’u da kullanabilirsiniz.

Ayrıca WPCode, en kullanışlı WordPress kod parçacıklarının tümünü bulabileceğiniz yerleşik bir parçacık kitaplığına sahiptir. Bu, otomatik güncellemeler, REST API, XML-RPC, yorumlar ve daha fazlası gibi istemediğiniz WordPress özelliklerini hızlı bir şekilde kaldırmanıza olanak tanır.

Not: Özel bulut snippet kütüphanesi, dönüştürme pikselleri, zamanlanmış snippetler, kod revizyonları ve daha fazlası gibi gelişmiş özellikler istiyorsanız WPCode Pro‘ya yükseltebilirsiniz.

Daha fazla ayrıntı için WordPress’e kolayca özel kod ekleme hakkındaki kılavuzumuzu okuyun.

Bununla birlikte, WPCode eklentisini kullanarak WordPress’te üstbilgi ve altbilgi kodunun nasıl kolayca ekleneceğini görelim.

Video Eğitimi

Subscribe to WPBeginner

Video eğitimini izlemek istemiyorsanız, aşağıdaki metin versiyonunu okumaya devam edebilirsiniz:

WordPress’te Üstbilgi ve Altbilgiye Kod Ekleme

Yapmanız gereken ilk şey ücretsiz WPCode eklentisini yüklemek ve etkinleştirmektir. Daha fazla ayrıntı için WordPress eklentisi yükleme hakkındaki adım adım kılavuzumuza bakın.

Eklenti etkinleştirildikten sonra, WordPress yönetici panelinizden Code Snippets ” Header & Footer bölümüne gidin. Bundan sonra, kodunuzu ekleyebileceğiniz bir ‘Üstbilgi’ kutusu göreceksiniz.

Add code to header and footer with WPCode

Aşağı kaydırırsanız, bir ‘Gövde’ ve bir ‘Altbilgi’ kutusu da göreceksiniz.

Header and footer script boxes WPCode

Kodu üç kutudan birine yapıştırmanız yeterlidir. İşiniz bittiğinde, ayarlarınızı kaydetmek için ‘Değişiklikleri Kaydet’ düğmesine tıklamayı unutmayın.

Eklenti artık kodu WordPress sitenizdeki ilgili konumlara otomatik olarak yükleyecektir.

Saklamak istemediğiniz kodları her zaman düzenleyebilir ve kaldırabilirsiniz.

Eklentiyi her zaman yüklü ve etkin tutmanız gerekir. Eklentinin devre dışı bırakılması sitenize tüm özel kodların eklenmesini durduracaktır.

Eklentiyi yanlışlıkla devre dışı bırakırsanız, kod hala WordPress veritabanınızda güvenli bir şekilde saklanacaktır. Eklentiyi yeniden yükleyebilir veya yeniden etkinleştirebilirsiniz ve kod tekrar görünmeye başlayacaktır.

Not: Kodun web sitenizin ön ucunda düzgün bir şekilde görünmesi için değişiklikleri kaydettikten sonra WordPress önbelleğinizi temizlemeniz gerekebilir.

Yeni başlayanların çoğunun WPCode eklentisini kullanmasının en büyük nedeninin web sitelerine Google Analytics eklemek olduğunu gördük. Bunun için aslında ücretsiz MonsterInsights eklentisini kullanmanızı öneririz.

MonsterInsights, WordPress için en iyi Google analitik eklentisidir. Sadece birkaç tıklamayla Google Analytics takibini düzgün bir şekilde kurmanıza yardımcı olur ve size doğrudan WordPress panonuzun içinde yararlı istatistikler gösterir.

Adım adım talimatlar için WordPress’te Google Analytics’in nasıl kurulacağına ilişkin bu eğitime bakın.

Umarız bu makale WordPress’te üstbilgi ve altbilgi kodlarının nasıl kolayca ekleneceğini öğrenmenize yardımcı olmuştur. En iyi e-posta pazarlama hizmetleri ve en iyi iş telefonu hizmetleri karşılaştırmamızı da görmek isteyebilirsiniz.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Açıklama: İçeriğimiz okuyucu desteklidir. Bu, bazı bağlantılarımıza tıklarsanız komisyon kazanabileceğimiz anlamına gelir. WPBeginner'ın nasıl finanse edildiğini, neden önemli olduğunu ve nasıl destek olabileceğinizi görün. İşte editoryal sürecimiz.

Avatar

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

Ultimate WordPress Araç Kiti

Araç setimize ÜCRETSİZ erişim sağlayın - her profesyonelin sahip olması gereken WordPress ile ilgili ürün ve kaynaklardan oluşan bir koleksiyon!

Reader Interactions

267 yorumBir Cevap Bırakın

  1. Syed Balkhi says

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

  2. Rattanak says

    Adsense give me copy code in to my site (between head) , where I can put code into my site?? I use premium plan!

  3. MADHUSUDAN says

    Hi,

    Your team member has tried to resolve my issue and they are on time .. but i just saw this place where we can leave a reply..

    I am trying to add a meta tag to my front page as required by my affiliate programm company to get to promote their product. I used add header and footer plug in as suggested by your team member and after adding and saving changes I do not see the changes .. how would the site look after adding the meta tag by the way the meta tag is as below

    OR the other option is to add a new page with their code which is .html . i tried to copy paste as but it remains as such. IS IT BECAUSE MY SITE IS PHP SUPPORT AND THE CODE IS HTML OR HOW?

    Hope to recieve your advice and feedback.

    • WPBeginner Support says

      Hi Madhusudan,

      The meta tags are located in your website’s HTML code. They are added in the header section or at the end. Meta tags are not visible on your website and do not make any change to your website’s appearance. You can still view the meta tag by viewing the source or using the inspect tool.

      Yönetici

  4. Angela says

    I have added the header/footer plug in. I added my facebook pixel code and hit saved. But how to I install this code to specific pages of my website so I can track certain conversions?

  5. Jen says

    I use this plug-in all the time with no issues. Today, I installed it and added my code needed into the correct area. Every page is showing the code except the home page. Any idea why every page would have the code except the home page?

  6. John says

    This post doesn’t teach what script to put in the footer though. What simple script can I use to get started? I just want a simple footer.

  7. Sarthak says

    I am having an issue her. It would be very helpful of you to resolve my issue.
    I have to add the code of google adsense in the header of my website, but earlier i had added the instant article code in the header, now what shold i do to keep both of them?
    (As i am the beginner, so i don’ know much about it. Help me please.)

  8. George Beasley Jr says

    I tried installing the “Insert Headers and Footers” into my website. When I go to “Settings/Insert Headers and Footers”, I get this error: (Fatal error: Call to undefined function wp_unslash() in /home/afvetrep/public_html/wp-content/plugins/insert-headers-and-footers/ihaf.php on line 169)
    What do I do?

    • WPBeginner Support says

      Hey George,

      wp_unslash() is a standard WordPress core function since WordPress 3.6. If you are using an older version of WordPress, then you need to update WordPress.

      If you are using the latest version of WordPress and still seeing this error, then let us know and we will help you troubleshoot.

      Yönetici

  9. Frank says

    Hi. I am inserting a MailChimp popup script into the footer and this breaks my WP main navigation menu. Any idea why or how to fix it ? I just upgraded to your latest plugin version but the problem persists. Thanks.

  10. Riju says

    Please help me
    I can’t see any editor on appearance..
    I need to put webmaster tool verify meta code in how can I edit the header?
    Need help

  11. Riju says

    Hi, I can’t see any
    I’m trying to connect my WB with Adsense

    Can i add Adsense ad code on WordPress after using mobile???
    Please help

  12. echenze says

    Hi, can this still be used to insert the code that one is given for verification of a Google Adsense account?

  13. Samuel says

    This is one of my best plugins and i use em frequently to add codes to the header and footer, but something happen after i update the plugins few hours ago, it gave an error [Fatal error: Can’t use function return value in write context in /home/campmmcg/public_html/wp-content/plugins/insert-headers-and-footers/ihaf.php on line 102]

    Please resolve this

  14. Meaghan Nutt says

    This was really easy but it changed my header on the website and it is huge! It has pushed down my slider and my content for a huge white box. Help!

  15. massive says

    Thank you for this greate article, my question can I use this plugin to insert ad codes like ad codes of affiliates programs?

  16. Rizwan Amjad says

    Hellow.. i am using this plugin, I have a question that can i use this plugin to insert multiple codes in this way..

    Code 1
    Code 2
    Code 3

    Simply Code 1 and then Enter Button and code 2 and enter button.

    I want to insert codes likes google authorship, analytics, webmaster, etc.

      • Isabella says

        Hi, This is probably a silly question, but if I already installed a facebook script in the header and now want to install another one from Hotjar, I am deleting the prior Facebook script so it is not re- installed, correct? Sorry I am not well versed in code.

        Thanks

  17. Vladimír says

    This is grat plugin, I see it is more than one year without updates. Could you please update it?

    Vladimir

  18. Lauren says

    Thanks so much for the video. I tried to figure this out through other websites, and with my own brain, but I was still unsure. Your video was short and sweet, and finally gave me the visuals I needed to get the job done. Thanks again!

  19. khalid says

    hey amazing people, i installed and added FB instant article code but FB still says that the code is not in the website.

    I have added it to head section part.

    • Suzanne Ball says

      I get “403 Forbidden

      A potentially unsafe operation has been detected in your request to this site.”

      when I insert the google script

  20. Rene Hedges says

    Thank you! Being very new to site building, and with no experience with working with coding, this was easy to follow!

  21. Marcelo Guimaraes says

    Hello! I am using Insert Headers and Footers to add the Google Analytics code to my WP site. Do I need to worry about each page on my site separately or am I covering the entire site simply by following the instructions on this video and adding the code to the Headers box (Insert Headers and Footers > Settings)?

  22. Patrick Saad says

    Hello !

    This would be my first time using your plugin. I am hoping to render my web site more secure by adding these following scripts in the header :

    X-Content-Type-Options: nosniff

    X-Frame-Options: SAMEORIGIN

    X-XSS-Protection: 1; mode=block

    My questions are : Can I use your plugin to do this and if so do I make the header addition scripts one at a time or as I have typed them here.

    Thanks for your help !

  23. Conrad Hall says

    Hi,

    I’m new to WPBeginner.com, and this is the first tutorial I have viewed. To be blunt, I’m stunned that a tutorial says “Here you see two text boxes where you can add your code. Simply copy and paste any meta information, scripts, Google Analytics, etc. and click “save settings”. This code will now be output to either your header or you footer.”

    Regrettably, there are no links to information that helps a beginner understand how to get, or use, any of the code indicated. This renders the plugin useless to me.

    My use for this plugin is to use it for connecting to pages such as privacy policy and publisher disclaimer. Is there a tutorial somewhere that shows this? if so, please link to it from this page.

  24. Richard Bauer says

    Can Headers be static menus that include text, graphics, and links to pages? Same for Footers.
    is my site and is developed using FrontPage. We want to simply convert the entire site to Word Press as simple as possible. All links are to other site pages, site PDF and Word files, and a few external links. No Forms, No dynamic database, NO searches.

    any help would be appreciated

  25. WPBeginner Staff says

    It seems like your WordPress theme does not uses the standard wp_header and wp_footer functions. Please try switching temporarily to a default theme like twenty thirteen and see if the problem persists.

  26. Mufidah Kassalias says

    I’ve been using this plugin happily until the other day when we upgraded to the latest theme version (a major upgrade). The plugin broke our menu (it took quite a bit of investigation to narrow it down and be sure it was this plugin causing the conflict), so I’ve had to deactivate it. As you can imagine this is not a great solution, since our Google site verification, publisher info, analytics tracking and so on no longer exist in the head of our site. Do you have any suggestions regarding additional code I could include that would resolve the problem? Thank you.

  27. Andrea says

    Hi there. I’ve noticed that I have to deactivate the plugin in order to see my images to insert them into a post. Is there way to fix this? I love the plugin otherwise!

  28. Krista says

    Hi there,
    I am trying to update my one line of code in google analytics to get demographic info. I am sure I have pasted it correctly into the header(and footer, which I have always had there, but just read in a previous comment is unnecessary.) When I clcik the button in google analytics to validate code, it does not recognize the change. Have tried several times. Could you help me figure out how to solve this, please? Thanks!

  29. Bob says

    I’m using Genesis and am looking for a footer which is much more plug and play such as a widget where typical footer fields can be entered by a business user (non-coder). Even the available widget-based footers I see in the marketplace only go as far as saying ok, here’s your space, now add a random widget with some code snippets (way beyond my skills).

    If that magic doesn’t exist, can I just copy the footer code you are using on wpbeginner.com, edit the info and paste it into a Text widget into my Footer 1 position?

  30. april whitlow says

    If I am using this for google analytics, do i insert it into the header and footer or just the footer. sorry for the simple question. I am at the very beginning of learning.

  31. Vince says

    How do you add header scripts in just “one specific” page? This plugin is only applicable if you are adding a script for all the pages, but is not applicable if you will add it in a specific page.

    • Rya says

      for “How do you add header scripts in just “one specific” page? This plugin is only applicable if you are adding a script for all the pages, but is not applicable if you will add it in a specific page.”
      You can use php w/ the following info:
      http://codex.wordpress.org/Conditional_Tags
      in conjunction with your scripts.

  32. Fayola says

    I did this and I see that the script appears in the footer of my page. However, Google Analytics still says that the tracking is not installed. Please help!

  33. Stan Peters says

    I get Notice: wp_register_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or init hooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.) in C:\tools\xampp\htdocs\wpfrontier\wp-includes\functions.php on line 2758
    when I use it to insert google font code in header

    • Editorial Staff says

      This plugin is mainly created for analytics script, or meta information. This is not meant to be used for inserting jQuery or other design elements like those. The purpose was to allow users to easily add tags in their head or footer without editing theme files.

      Yönetici

  34. Mladen says

    I have tried to add FB meta tags in header with this plugin, but it didn’t work. The idea is good, though.

      • Mladen says

        Well, I don’t know if those tags are dynamic or static :) I tried the standard Facebook tags such as this:

        <meta property="og:url" content="”/>
        <meta property="og:title" content="” />
        <meta property="og:description" content="ID)); ?>” />

        <meta property="og:image" content="ID ) ) ?>” />

        Can you tell me if this plugin is good for this purpose? Thanks

  35. Gautam Doddamani says

    a great plugin but my custom theme already has this option! will bookmark this post in case i change my themes.

    • Editorial Staff says

      Yeah it’s main purpose is to keep you from being theme dependent. Often people place their Analytics codes etc in their theme’s footer scripts area like this. Then they forgot about it when they switch themes. This causes them to lose analytics data for number of days.

      Yönetici

Bir Cevap Bırakın

Yorum bırakmayı seçtiğiniz için teşekkür ederiz. Lütfen tüm yorumların yorum poli̇ti̇kasi uyarınca denetlendiğini ve e-posta adresinizin yayımlanmayacağını unutmayın. Ad alanında anahtar kelime KULLANMAYIN. Kişisel ve anlamlı bir sohbet edelim.