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

Bilmiyor Olabileceğiniz 15 Faydalı WordPress Yapılandırma Püf Noktası

WP-config, WordPress sitenizdeki en güçlü dosyalardan biridir ve WordPress’in perde arkasında nasıl çalıştığı konusunda önemli bir rol oynar.

WPBeginner’da yıllardır WordPress ile uğraşıyoruz ve yeni başlayanların çoğunun bilmediği bazı çok kullanışlı WordPress yapılandırma hileleri keşfettik.

İster bellek sorunlarıyla uğraşıyor, ister daha iyi güvenliğe ihtiyaç duyuyor ya da geliştirme iş akışınızı hızlandırmak istiyor olun, doğru wp-config ayarlamaları sitenizin çalışma şeklini değiştirebilir.

Bu makalede, WordPress sitenizin sorunlarını gidermenize, optimize etmenize ve güvenliğini sağlamanıza yardımcı olacak en kullanışlı WordPress yapılandırma hilelerinden bazılarını paylaşacağız.

Useful WordPress configuration tricks

Bu WordPress Yapılandırma Püf Noktaları Nasıl Kullanılır?

WordPress, wp-config.php adlı güçlü bir yapılandırma dosyasıyla birlikte gelir. Her WordPress sitesinin kök klasöründe bulunur ve önemli yapılandırma ayarlarını içerir.

Daha fazla bilgi edinmek için WordPress’te wp-config.php dosyasının nasıl düzenleneceğine ilişkin kılavuzumuza bakın.

En iyi WordPress barındırma şirketlerinin tümü tek tıkla WordPress kurulumu ile birlikte gelir, bu da kurulum sırasında wp-config.php dosyasını düzenlemenize asla gerek kalmayacağı anlamına gelir. Birçok kullanıcının bu dosyanın gücüne aşina olmamasının ana nedeni budur.

WordPress sitenizin sorunlarını gidermek, optimize etmek ve güvenliğini sağlamak için wp-config dosyasını kullanabilirsiniz.

wp-config.php dosyası güçlü bir araçtır ve koddaki küçük bir hata web sitenizi erişilemez hale getirebilir. Bu dosyayı yalnızca gerekli olduğunda düzenlemeli ve herhangi bir değişiklik yapmadan önce her zaman eksiksiz bir WordPress yedeği oluşturmalısınız,

Bununla birlikte, WordPress web sitenizde kullanabileceğiniz bazı kullanışlı WordPress yapılandırma hilelerine bir göz atalım. En çok ilgilendiğiniz püf noktalarına doğrudan atlamak için aşağıdaki hızlı bağlantıları kullanabilirsiniz:

1. Temel WordPress Yapılandırma Ayarları

Varsayılan olarak, WordPress kurulumu sırasında yalnızca veritabanı ayarlarını doldurmanız gerekir. Eğer bir wp-config.php dosyanız yoksa, veritabanı bilgilerinizi girerek bir dosya oluşturmanız istenecektir.

Default WordPress configuration settings

WordPress bir wp-config.php dosyası oluşturarak bu ayarları otomatik olarak kaydetmeye çalışacaktır. Ancak, başarısız olursa, bunları manuel olarak eklemeniz gerekecektir.

Bunu yapmak için, bir FTP istemcisi kullanarak web sitenize bağlanmanız gerekecektir. Bağlandıktan sonra, wp-config-sample.php dosyasını wp-config.php olarak yeniden adlandırmanız gerekecektir.

Rename wp-config-sample.php file

Bundan sonra, devam edebilir ve yeni oluşturulan wp-config.php dosyasını düzenleyebilirsiniz. Aşağıdaki satırları değiştirerek veritabanı bilgilerinizi eklemeniz gerekecektir:

define('DB_NAME', 'database-name');
define('DB_USER', 'database-username');
define('DB_PASSWORD', 'database-password');
define('DB_HOST', 'localhost');

Değişikliklerinizi kaydetmeyi ve dosyayı sunucuya geri yüklemeyi unutmayın.

2. WordPress’te Güvenlik Anahtarları Ekleme

Varsayılan WordPress kurulumu, yapılandırma dosyanıza otomatik olarak güvenlik anahtarları ekler. Bu güvenlik anahtarları, WordPress oturum açma ve çerez kimlik doğrulamanıza ekstra bir güvenlik katmanı eklemek için kullanılır.

Birisinin web sitenize uygun kimlik doğrulaması olmadan erişebileceğini düşünüyorsanız, güvenlik anahtar larını her zaman yeniden oluşturabilirsiniz. Güvenlik anahtarlarını değiştirmek, oturum açmış tüm kullanıcıların oturumunu kapatacaktır.

define( 'AUTH_KEY',         'put your unique phrase here' );
define( 'SECURE_AUTH_KEY',  'put your unique phrase here' );
define( 'LOGGED_IN_KEY',    'put your unique phrase here' );
define( 'NONCE_KEY',        'put your unique phrase here' );
define( 'AUTH_SALT',        'put your unique phrase here' );
define( 'SECURE_AUTH_SALT', 'put your unique phrase here' );
define( 'LOGGED_IN_SALT',   'put your unique phrase here' );
define( 'NONCE_SALT',       'put your unique phrase here' );

Daha fazla bilgi için WordPress güvenlik anahtarları ve bunların nasıl kullanılacağı hakkındaki makalemize bakın.

3. WordPress Tablo Önekini Değiştirme

Tipik bir varsayılan WordPress kurulumu, tüm WordPress veritabanı tablo adlarına bir wp_ öneki ekler. Bazı WordPress güvenlik uzmanları, tablo önekini değiştirmenin WordPress veritabanınızı daha güvenli hale getirebileceğine inanmaktadır.

Bunu yapmak için, WordPress yapılandırmanızda aşağıdaki satırı değiştirmeniz gerekir.

$table_prefix = 'wp_';

Bunu mevcut bir web sitesi için yapıyorsanız, WordPress veritabanınızdaki tablo önekini de değiştirmeniz gerekecektir. Bunu yapmak için, WordPress veritabanı önekinin nasıl değiştirileceğine ilişkin makalemize bakın.

4. WordPress’te Hata Ayıklamayı Açın

WordPress, hata ayıklama modundayken WordPress hatalarını görmenizi veya gizlemenizi sağlayan düzgün bir hata ayıklama özelliği ile birlikte gelir. Bunu açmak için WordPress yapılandırma dosyanıza bu kuralı eklemeniz gerekecektir.

define( 'WP_DEBUG', true );

Web sitenizdeki hataları gizlerken ve bunun yerine bir günlük dosyasına kaydederken hata ayıklamayı da açabilirsiniz. Bunu yapmak için yapılandırma ayarlarınıza aşağıdaki satırları ekleyin.

define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );

Bu, web sitenizin wp-content klasörü içinde bir debug.log dosyası oluşturacak ve tüm hata ayıklama hatalarını ve bildirimlerini günlük dosyasında saklayacaktır.

5. Sitenizi veya WordPress Adresinizi Değiştirme

Normalde WordPress ve Site URL’lerinizi Ayarlar ” Genel sayfasından ayarlayabilirsiniz. Ancak, WordPress sitenize erişiminiz yoksa, yönlendirme hataları görüyorsanız veya sitenizi yeni taşıdıysanız bunu yapamayabilirsiniz.

Bu durumda, aşağıdaki satırları ekleyerek wp-config.php dosyası üzerinden sitenizi ve WordPress URL’lerinizi değiştirebilirsiniz:

define('WP_HOME', 'http://www.example.com');
define('WP_SITEURL', 'http://www.example.com');

example.com yerine kendi alan adınızı yazmayı unutmayın.

6. Dosya İzinlerini Geçersiz Kılma

WordPress, barındırıcınız tüm kullanıcı dosyaları için kısıtlayıcı izinlere sahipse dosya izinlerini geçersiz kılmanıza olanak tanır. Çoğu kullanıcı buna ihtiyaç duymaz, ancak ihtiyaç duyanlar için mevcuttur.

define('FS_CHMOD_FILE', 0644);
define('FS_CHMOD_DIR', 0755);

Dosya izinleri hakkında daha fazla bilgi edinmek için WordPress’te dosya ve klasör izinleri hatası nasıl düzeltilir makalemize bakın.

7. Revizyon Sonrası Ayarlarını Değiştirme

WordPress, önceki bir sürüme veya otomatik kaydetmeye geri dönerek yazılarınızda ve sayfalarınızda yaptığınız değişiklikleri geri almanıza olanak tanıyan çok kullanışlı bir yazı revizyonu özelliğine sahiptir.

Yapılandırma dosyası aracılığıyla revizyon sonrası ayarlarını devre dışı bırakabilir veya değiştirebilirsiniz. İşte kullanabileceğiniz farklı revizyon sonrası ayarları.

Aşağıdaki satırı ekleyerek WordPress’in bir otomatik kaydetmeyi revizyon olarak saklama sıklığını değiştirebilirsiniz:

define('AUTOSAVE_INTERVAL', 120); // in seconds

Sitenizdeki bazı makalelerin yazılmasının ne kadar sürdüğüne bağlı olarak düzinelerce yazı revizyonu olabilir. Bu özelliğin sizi rahatsız ettiğini düşünüyorsanız, yazı başına revizyon sayısını sınırlayabilirsiniz.

define('WP_POST_REVISIONS', 10);

Herhangi bir nedenle gönderi revizyonları özelliğini tamamen devre dışı bırakmak istiyorsanız (hiç tavsiye edilmez), gönderi revizyonlarını devre dışı bırakmak için aşağıdaki kodu kullanabilirsiniz.

define( 'WP_POST_REVISIONS', false );

8. WordPress Çöp Kutusu Ayarlarını Değiştirme

WordPress, Çöp Kutusu adı verilen bir geri dönüşüm kutusu özelliği ile birlikte gelir. Bir kullanıcı bir yazıyı çöp kutusuna gönderdiğinde, bu yazı sonraki 30 gün boyunca web sitenizde çöp kutusu olarak saklanmaya devam eder. Bu süreden sonra, WordPress bunları otomatik olarak sonsuza kadar siler.

Çöpü saklamak istediğiniz gün sayısını değiştirerek bu davranışı değiştirebilirsiniz.

define( 'EMPTY_TRASH_DAYS', 15 ); // 15 days

Bu özelliği beğenmediyseniz, aşağıdaki işlevi ekleyerek devre dışı bırakabilirsiniz:

define('EMPTY_TRASH_DAYS', 0 );

Not: Sıfır seçeneğini kullanmak gönderilerinizin kalıcı olarak silineceği anlamına gelir. Kalıcı Olarak Sil seçeneğine tıkladığınızda WordPress onay istemeyecektir. Yanlışlıkla tıklamak size pahalıya mal olabilir…

Daha fazla bilgi edinmek için WordPress’te otomatik boş çöp kutusu özelliğini sınırlama veya devre dışı bırakma hakkındaki makalemize bakın.

9. WordPress Yapılandırmasına FTP/SSH Sabitleri Ekleme

WordPress varsayılan olarak WordPress çekirdeğini, temalarını ve eklentilerini yönetici panosundan yükseltmenize izin verir. Her yükseltme veya yeni bir eklenti yüklemeye çalıştığınızda FTP veya SSH bağlantısı gerektiren bazı ana bilgisayarlar vardır.

WordPress asking for FTP information

Kodları kullanarak FTP veya SSH sabitlerini ayarlayabilir ve bir daha asla bu konuda endişelenmenize gerek kalmaz.

// forces the filesystem method: "direct", "ssh", "ftpext", or "ftpsockets"
define('FS_METHOD', 'ftpext');
// absolute path to root installation directory
define('FTP_BASE', '/path/to/wordpress/');
// absolute path to "wp-content" directory
define('FTP_CONTENT_DIR', '/path/to/wordpress/wp-content/');
// absolute path to "wp-plugins" directory
define('FTP_PLUGIN_DIR ', '/path/to/wordpress/wp-content/plugins/');
// absolute path to your SSH public key
define('FTP_PUBKEY', '/home/username/.ssh/id_rsa.pub');
// absolute path to your SSH private key
define('FTP_PRIVKEY', '/home/username/.ssh/id_rsa');
// either your FTP or SSH username
define('FTP_USER', 'username');
// password for FTP_USER username
define('FTP_PASS', 'password');
// hostname:port combo for your SSH/FTP server
define('FTP_HOST', 'ftp.example.org:21'); 

Not: WordPress yolunu ve ftp.example.com adresini kendi FTP Ana Bilgisayar bilgilerinizle değiştirmeyi unutmayın.

10. Otomatik Veritabanı Onarımına İzin Ver

WordPress, WordPress veritabanını otomatik olarak optimize etmek ve onarmak için yerleşik bir özellikle birlikte gelir. Ancak bu özellik varsayılan olarak kapalıdır.

Bu özelliği etkinleştirmek için WordPress yapılandırma dosyanıza aşağıdaki satırı eklemeniz gerekir.

define('WP_ALLOW_REPAIR', true);

Bunu ekledikten sonra, WordPress veritabanını optimize etmek ve onarmak için aşağıdaki URL’yi ziyaret etmeniz gerekir.

http://example.com/wp-admin/maint/repair.php

example.com yerine kendi alan adınızı yazmayı unutmayın. Veritabanını onarma veya onarma ve optimize etme seçeneklerini içeren basit bir sayfa göreceksiniz. Bu sayfaya erişmek için oturum açmış olmanız gerekmez.

Optimize and repair WordPress database

11. PHP Bellek Sınırını Artırın

En yaygın WordPress hatalarından bazıları PHP belleğinin tükenmesinden kaynaklanır. PHP bellek sınırını wp-config.php dosyası aracılığıyla artırabilirsiniz. Aşağıdaki kodu yapıştırmanız yeterlidir:

define('WP_MEMORY_LIMIT', '128M');

12. wp-content Dizinini Taşıma

WordPress, wp-content dizininizi taşımanıza izin verir. Bazı uzmanlar bunun WordPress güvenliğini güçlendirmeye yardımcı olabileceğine inanıyor.

Aşağıdaki kodu wp-config.php dosyanıza eklemeniz gerekecektir:

define( 'WP_CONTENT_DIR', $_SERVER['DOCUMENT_ROOT'] . '/blog/wp-content' );
define( 'WP_CONTENT_URL', 'http://example/blog/wp-content');
define( 'WP_PLUGIN_DIR', $_SERVER['DOCUMENT_ROOT'] . '/blog/wp-content/plugins' );
define( 'WP_PLUGIN_URL', 'http://example/blog/wp-content/plugins');

example.com yerine kendi alan adınızı yazmayı unutmayın.

13. Özel Kullanıcı Tablolarını Kullanma

WordPress varsayılan olarak tüm kullanıcı verilerini wp_users ve wp_usermeta tablolarına kaydeder. Aşağıdaki fonksiyonu kullanarak, kullanıcı bilgilerinizin saklanmasını istediğiniz tabloyu belirleyebilirsiniz.

define('CUSTOM_USER_TABLE', $table_prefix.'my_users');
define('CUSTOM_USER_META_TABLE', $table_prefix.'my_usermeta');

14. Çoklu Site Ağını Etkinleştir

Her WordPress sitesi, aynı kurulumu kullanarak birden fazla WordPress sitesi oluşturmanıza olanak tanıyan yerleşik bir çoklu site özelliği ile birlikte gelir. Daha fazla bilgi edinmek için WordPress çoklu site ağının nasıl kurulacağı ve ayarlanacağı hakkındaki eksiksiz kılavuzumuza bakın.

WordPress yapılandırma dosyanıza aşağıdaki satırı ekleyerek çoklu site işlevselliğini etkinleştirebilirsiniz:

define('WP_ALLOW_MULTISITE', true);

15. WordPress Yapılandırma Dosyanızın Güvenliğini Sağlama

Gördüğünüz gibi, wp-config.php dosyası gerçekten önemli WordPress ayarlarını içerir. Varsayılan olarak kök WordPress klasöründe bulunur, ancak taşıyabilirsiniz. public_html dizininizin dışına taşınabilir, böylece kullanıcılar ona erişemez. WordPress, dosyalar WordPress kök klasöründe bulunmazsa varsayılan olarak diğer dizinlere bakmayı bilir.

Bu dosyaya erişimi sınırlamak için .htaccess dosyanıza aşağıdaki kodu da ekleyebilirsiniz.

# Protect wp-config.php
<Files wp-config.php>
    order allow,deny
    deny from all
</Files>

Umarız bu makale bilmediğiniz bazı yararlı WordPress yapılandırma hilelerini öğrenmenize yardımcı olmuştur. Sitenizde kullanabileceğiniz en çok aranan 57’den fazla WordPress ipucu, püf noktası ve hack’ten oluşan mega listemizi veya WordPress serbest çalışanları, tasarımcıları ve geliştiricileri için en iyi araçlardan oluşan seçimlerimizi de 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.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us. Here's our editorial process.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit - a collection of WordPress related products and resources that every professional should have!

Reader Interactions

51 yorumLeave a Reply

  1. Thank you for the great article. I was particularly interested in point 2, as I constantly struggled to understand the function of these security keys. Thanks for the link in the article to additional content, where I was finally able to learn much more about this function and better understand the whole issue. Regarding point 4, is it good to keep the debug log enabled, or should it only be turned on in case of a problem?

    • In most cases it is recommended to not have debug mode active unless you are looking for an error on your site. :)

      Admin

  2. hello and thanks for this important post .
    my question is where i must add this codes , in the config.php file
    but in which line exactly .

    regards

    • There is no specific line but it is normally best to add the code to the bottom so it is easy to find and remove should you want in the future.

      Admin

  3. Thanks for this useful post.
    i was looking for this 10. Allow Automatic Database Repair.
    Thank you very much.

    Thanks and Regards,
    Gurjit Singh

  4. I rely on your tutorials for my website development. The problems here are that you did not state clearly where these codes will be pasted in the various environments. Looking forward to your response.

  5. Wow really awesome. This helped so much.

    I’m wresting with one thing setting up my own CDN (which the above took care of 98%:).

    I’m trying to exclude a sub-folder on my CDN sub-domain as it’s throwing an access violation.

    I’ve tried a half dozen NGINX CORS directives in a server block .conf with no joy.

    I want to figure out how to use this file in the main domain rather than how it’s written below:

    Access to Font at ‘https://cdn.mydomain.com/wp-content/themes/mytheme/includes/lib/assets/fonts/fontawesome/fontawesome-webfont.woff?v=4.7.0’ from origin ‘https://mydomain.com’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘https://mydomain.com’ is therefore not allowed access.

    Thanks if you can point me to a fix or relevant info you may have !!

    Stu

  6. They can verufy the information in the wp-config.php if the password or database names correspond and change them if not.

  7. My WordPress website adds weird numbers as suffix to every page URL. Why is it happening? I changed the permalinks settings to display post names; it didn’t help.

    Could you please guide me?

    Here are a few page urls of my site:

  8. I use useronline plugin…When am in the useronline dashboard I notice that some users want to access my default css, upload images link with their browser! So am scared may be they want to hack my site! Please any help on how to stop them

  9. WordPress Error Log –

    How should I do this in a local environment?

    I’m currently using DesktopServer (Xampp lite – Installs sites with .dev extension locally eg. “mysite.dev”) with SourceTree (Git) – However trying to figure out what the path I should be using to my error log file is proving difficult. Could I use a full URL path such as “http://mysite.dev/php_error.log” ? or does it need to be the system file path “C:/Users/Garratt/Documents/mysite.dev/php_error.log” ?

  10. Got a question: How do I transfer ownership of a site from one user to another? Like I set it up with my admin account, but I want to have another user be the main admin and do updates and posts. I doubt I can just set them as an admin and myself as a subscriber and be done with it, so what’s the correct route of doing so?

    • Yes that’s one way to do it. A WordPress site can also have multiple administrators.

      If you also want to transfer them the ownership of domain, web hosting, and database then you will have to create a user account for them in your web hosting control panel. After that you can give them the complete control on domain, hosting, and database as well.

      • They already have all that, I’m just helping them redevelop their website (cause it’s not a good look right now nor is it easy to update ATM). Found this awesome church theme for them (cause it’s my church’s website I’m working on), and wanted to see how difficult it would be to switch admins. Last time a site of mine had multiple admins, just the first admin (ID #1) could update the plugins, themes, and WP in general.

  11. After I got rid of the database error, now I dont have any errors but now I have just blank page with no source code ? Please help what to do now. Thnaks

  12. I can’t thank you more! You’ve touched on the heart of any online work in a very clear way! You’re great teachers indeed! It can’t be any better than this! Write more!

  13. Hey Guys
    Great site, great info just found it. with the secure

    Securing Your WP-Config File
    where is the code that we need? please

    Brad

  14. is there any configuration in wordpress 3.5 so that the uploaded files will use the defined WP_HOME or WP_SITEURL? thanks

  15. Awesome. There is so much stuff about wordpress I didn’t even know. Like the repair database define code. this is one great article. I will have to bookmark this for sure.

  16. Thanks for this useful tips.I!m a beginner and I have a wordpress.org web site.
    I have followed your instructions and changed the wp-config file by copying the secure keys grabbed from the web site: https://api.wordpress.org/secret-key/1.1/salt/
    After putting the new config file into the WP-Admin Folder in the server it gives an error “Parse error: syntax error, unexpected T_VARIABLE….”
    That line is: “$table_prefix  = ‘wp_’;” and it has never been changed.
    How can I correct this error? Thanks.

  17. Great information about such an important are as configuration. With all the pharma hacks going on recently the last tip is my favourite. Protecting that damn wp-config file seems to be the key to palace these days.

    Thank you for the effort putting all of this information in one place for us all to benefit.

    kind regards
    Tony

    • You will never move the .htaccess file anywhere. That file remains in your public_html folder or the folder where WordPress is installed… The code in that file will disallow all access to wp-config.php file from the web.

      You can move the wp-config.php file to the root directory (one above public_html) to add an extra layer of security. One or the other would be fine… doing both is an overkill.

      Admin

  18. For reference, 3.0 does not include more security keys, nor were 2.9 installs any less secure when it came to authentication.

    The first four are keys. The last four are salts. The salts were missing from wp-config.php before 3.0, but we actually added salts a few versions ago. We added them to wp-config.php in 3.0 so we could easily populate them on install, but they are not necessary.

    If salts are not defined (or remain the default, e.g. “Enter unique phrase here”), then WP simply generates random strings to use as salts and stores those in the database.

    Also, for an error log, you should instead use these constants:


    define( 'WP_DEBUG', true ); // Enables error reporting.
    define( 'WP_DEBUG_DISPLAY', false ); // Hides the errors.
    define( 'WP_DEBUG_LOG', true ); // Logs errors to wp-content/error.log (or use @ini_set('error_log') )

    This has the added benefit of exposing PHP notices, which provide developers warnings about code that could be better or may have errors in it.

  19. $_ENV{DATABASE_SERVER} ??
    Syntax doesn’t look correct to me ($_ENV[‘stuff’] maybe but {stuff} I don’t think so) and I’ve just checked, couldn’t find any host I have access to that has this defined. Definitely not something common.

    Other than this, nice roundup. Note that WP doesn’t look “in other directories” to find wp-config.php, it just goes one directory up (which is in most case out of the server document root).

  20. Thanks so much for all of this great info. This is the side of WordPress I need to learn more about so I’m going to use this post as a springboard to really dive in.

Leave A Reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.