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 Sorgu Sayısı ve Sayfa Yükleme Süresi Nasıl Gösterilir?

Kullanıcılarımızdan biri, diğer sitelerin altbilgide sorgu sayısını ve sayfa yükleme süresini nasıl gösterdiğini sordu. Bunu genellikle sitelerin altbilgisinde görürsünüz ve şöyle bir şey yazabilir: “1,248 saniyede 64 sorgu”. Bu makalede, WordPress’te sorgu sayısını ve sayfa yükleme süresini nasıl göstereceğinizi göstereceğiz.

Aşağıdaki kodu tema dosyalarınızda (footer.php gibi) istediğiniz yere yapıştırmanız yeterlidir.

<?php echo get_num_queries(); ?> queries in <?php timer_stop(1); ?> seconds.

Ve sayfayı yenileyin. Sorgu sayısını ve yürütme süresini göreceksiniz.

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

7 yorumBir Cevap Bırakın

  1. Syed Balkhi

    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. Pattrick

    How can i display only the load Time ?

    • WPBeginner Support

      You would move the echo to after the get_num_queries

      Yönetici

  3. Aidan

    You should make clear that the timer_stop() function only measures page load time, not how long the queries take to complete.
    These are often related, but the way you present the code makes it look like the queries are always related to the speed issues, and often they aren’t.

  4. Sean Donovan

    It would be useful to know what a typical number of queries are for a WordPress site running 10 or so plugins…

    • Editorial Staff

      Can’t say at all because each plugin varies. You can use 10 plugins that work entirely in the backend which will add no queries on the front-end load. Or 10 really horrible coded plugins that can add tons of queries on the front-end.

      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.