wp-config.php is the configuration file of WordPress, one of few that is not overridden during upgrades. It is essential for running WordPress, as it contains the information needed to connect to the database

learn more… | top users | synonyms

55
votes
8answers
16k views

Is moving wp-config outside the web root really beneficial?

One of the most common security best practices these days seems to be moving wp-config.php one directory higher than the vhost's document root. I've never really found a good explanation for that, but ...
20
votes
4answers
3k views

Best practice for versioning wp-config.php?

Is there a best practice for including your wp-config.php file in your version control repository? I'm considering creating a new site with this type of configuration, (similar to Alex King and Mark ...
10
votes
3answers
2k views

Define WP_DEBUG conditionally / for admins only / log errors (append query arg for all links?)

I'm developing a site on a server that the client has access to as well and what I'd like to do is show WP_DEBUG only for administrators. Referencing Yoast's article on a way around this: if ( ...
10
votes
2answers
1k views

Symbolic Links on dev box with plugins and stylesheets

I'm using mac os x 10.6 with xampp. http://wp3.1/ is the url to where I have WordPress installed. The physical path is /Users/myUserName/Sites/wp3.1/ I do not install plugins or themes in the ...
8
votes
1answer
3k views

Moving a WP Multisite to a subdirectory

Firstly, I've read a number of posts on this process. However, for various reasons, the process remains difficult to implement or troubleshoot for lack of even abstracted examples, or maybe too ...
7
votes
4answers
482 views

Password in wp-config. Dangerous?

I don't know a lot of Wordpress yet, and I'm just wondering: Before installation you have to fill in the correct data in wp-config-sample.php but this also includes the database password. Isn't that ...
6
votes
2answers
2k views

Prevent access or auto-delete readme.html, license.txt, wp-config-sample.php

Just a quick question that might help a tad bit with security. I noticed that the readme.html file has the version number listed. It reappears after each upgrade and so do the licence.txt, and ...
4
votes
3answers
4k views

What is the best way to get directory path for wp-config.php?

I am developer of the plugin mapsmarker.com which also offers several APIs which can be accessed directly (eg www.mapsmarker.com/wp-content/plugins/leaflet-maps-marker/leaflet-geojson.php?marker=1) ...
4
votes
1answer
98 views

How to individually set WP_DEBUG on a sub-directory multisite?

According to this question, it's possible to turn on/off WP_DEBUG for specific sites on a multisite. Is it possible to do this with a sub-directory multisite?
3
votes
1answer
678 views

domain mapping confused about sunrise

When i try to access my domain mapping page it asks me to move the line define('sunrise', 'on') above the last require_once line in the wp-config file. It is already above this line. I tried moving it ...
3
votes
3answers
2k views

Does changing 'WPLANG' in wp-config.php just effect the admin language or does it have other consequences?

I am curious to know if setting 'WPLANG' in wp-config.php just effects the admin language or does it have other consequences? I run a blog in a foreign language but use English in my admin. I ...
3
votes
1answer
357 views

Wordpress PHP error handling and reporting in production environment

I'm trying to find a solution on how to handle the displaying and logging of errors in a PHP (Wordpress) production environment. Is it possible to do the following (alternative suggestions welcome): ...
3
votes
3answers
1k views

Is it possible to change the log file location for WP_DEBUG_LOG?

I use WP_DEBUG_LOG in my development environment and have no issues with debug.log being in the wp-content directory. Sometimes I turn on WP_DEBUG in production when I need to debug something, and I ...
3
votes
3answers
663 views

Is there a way to define wp_blogs domains in wp-config?

In my multisite setup I have multiple environments that I want to share the same database, but use different domains. server1.example.com server2.example.com example.com ... each of those would ...
3
votes
2answers
10k views

Connect to database using wordpress wp-config file

How can I connect to the database using the wp-config.php file ? I'm trying to make a script more Wordpress friendly, and I need to connect to the database, but without installing the script as a ...
3
votes
1answer
1k views

How to define a remote uploads directory?

Using the constant overrides in wp-config I'm able to define a remote FTP server that plugins will be added to when installed using the WP interface. define('FS_METHOD', 'ftpext'); define('FTP_BASE', ...
2
votes
2answers
814 views

hook a functions to change wp-config from functions.php

is there a way to hook / filter or add action that would be printed in the wp-config file? lets say i want to add some simple command like "empty the trash" aka define('EMPTY_TRASH_DAYS', 1 ); ...
2
votes
2answers
213 views

How to update WordPress from the latest trunk

I read somewhere that I can set a constant in the wp-config.php to update WordPress from the latest trunk version and not the stable version. Stupid as I am, I can't find the site anymore where it was ...
2
votes
2answers
1k views

Turn Off Automatic Trash Deletion?

I have a client who wants to use the trash feature, but keep items in there indefinitely (I have no idea why, but they insist on it). From reading this codex article on the trash status, I see that ...
2
votes
2answers
203 views

Set wp-content folder to Dropbox folder

Ideally I would like to do this with both my PC and Mac OSX boxes, but for now I would be thrilled with just the Mac OSX. I am trying to keep my WP Themes & Plugin Local Development synced using ...
2
votes
1answer
2k views

Changing WP_CONTENT_DIR and WP_CONTENT_URL in wp-config.php does not register?

I tried to add this to the end of my wp-config.php define('WP_CONTENT_DIR', $_SERVER['DOCUMENT_ROOT'] . '/somedir'); define('WP_CONTENT_URL', 'http://example.com/somedir'); however, echo ...
2
votes
1answer
383 views

WP Config for FTP credentials

Is there a config in WP that allows you to store your FTP credentials? I'm using the Linux webserver at work to develop and it's really annoying to have to but the credentials in every time I ...
2
votes
1answer
85 views

get_template_directory_uri does not seem to work when defining WP_CONTENT_DIR

I have defined in my config: define( 'WP_CONTENT_DIR', dirname(__FILE__) . '/somedirectory' ); after Codex: Editing WP Config BUT <?php echo get_template_directory_uri(); ?> prints out: ...
2
votes
1answer
515 views

Generate Wordpress salt

I am in need of a function that automatically generates and returns salts for Wordpress wp-config.php (Don't link me to their API, I'm looking for offline solution). Does Wordpress core has this ...
2
votes
1answer
291 views

Different 'WP_CONTENT_URL' for different subsites in Multisite setup?

I host quite a few blogs on my network (WordPress Multisite) and have their static content served via a common CDN, by simply setting the wp-content directory URL in wp-config.php like so: # ...
2
votes
1answer
118 views

register_theme_directory somehow “fails” when folder is outside of WP-Folder

This is a simple skeleton for WordPress, that makes it possible to have just "themes" and "plugins" under version control: https://github.com/sourcerer-mike/WordPress-GIT-Skeleton When doing ...
2
votes
1answer
591 views

Override the wp_siteurl and wp_home not work

I created a wordpress site and name hostname as x.co.uk, x.com, x.in... In wp-option table the site and home url as x.co.uk. I want dynamically for loading other host name also. So dynamically set ...
2
votes
2answers
843 views

Renaming wp-content folder dynamically

Is it possible to rename the wp-content folder dynamically? I am building a custom framework to use on themes and it would be nice to set it up where it does everything on its own. I am using this ...
2
votes
1answer
310 views

Redirect one of two domains on one Wordpress installation

I have to domains: mydomain.dk and mydomain.de. Both are showing the same page in danish. I have a plugin that takes care of the languages, but I need to connect the .de domain to the german 'language ...
2
votes
2answers
94 views

Declaratively Configuring Wordpress in XML or JSON or YAML

Couldn't find this on Google... Is there any handy way of fully (or partially) configuring a Wordpress site (plugins and all) using XML/JSON/YAML/etc? In general, I'm looking for a highly-readable, ...
2
votes
1answer
700 views

integrating external php library into wordpress- the right way

If I were to load a custom library into wordpress, what would be the best place to add it? Since there are a bunch of global vars defined at the top of the library, I would not want that to be done ...
2
votes
1answer
262 views

Add additional Network constants to wp-config.php dynamically

When starting with a fresh Network install, the first step is a single site install that has one additional line in the wp-config.php file: define( 'WP_ALLOW_MULTISITE', true ); After that we have ...
2
votes
2answers
104 views

WP disobeys disabling of the posts revision feature

I disabled the posts revision feature according to this codex by placing this code in the wp-config.php: define('WP_POST_REVISIONS', false ); But revions are still being saved by the WP. Why? I am ...
1
vote
3answers
146 views

Putting my site live

Can anyone help? I've been building a wordpress site in a sub directory of an umbrella 'development domain' if you will, and am ready to go live with the site. It's a single install of wordpress. ...
1
vote
1answer
317 views

How to use if condition to change $table_prefix in wp_config.php

I am testing a very big database (perhaps wp_posts contains hundreds of thousands of rows). As such, the query time, especially the searching query, is extremely long. I'm thinking if there is any ...
1
vote
1answer
779 views

Securing wp-config leads to sensitive information leak on wp-settings

I read the following tutorial, which mentions moving your config file out of an HTTP-accessible folder. http://codex.wordpress.org/Hardening_WordPress#Securing_wp-config.php I did this, and it works ...
1
vote
1answer
84 views

How to Better Control WordPress Cron Jobs?

I have a bunch of standalone WordPress sites, and WordPress Multisite Network of Sites on my server. There are times where there are too many sites all running cron jobs too soon in proximity. I am ...
1
vote
2answers
150 views

Why do I get a WAMP homepage when clicking on specific website's URL on LocalHost?

Using WAMPSERVER for windows 7, smartgit and Safe Search Replace I have pulled a wordpress code from my git, downloaded a database and inserted into my localhost's phpmyadmin. My home page works but ...
1
vote
2answers
359 views

Why am I unable to login after converting to www?

So I originally designed the site without the www. I've since realized that it's going to cause more problems than necessary. I created a rewrite rule that converts to www. I then changed the ...
1
vote
2answers
2k views

Character encoding issue after changing servers

I recently moved my WordPress-based site from DreamHost VPS to a Linode VPS running Debian + LEMP. After getting the site up again, I noticed many erroneous characters in posts; characters like " and ...
1
vote
2answers
114 views

Can you limit the memory usage of a particular plugin?

I know that it is possible to restrict (or extend) the memory usage of the entire WP site using: define('WP_MEMORY_LIMIT', '64M') Is it possible to do the same for only one plugin that the website ...
1
vote
1answer
28 views

Prevent WordPress updates from overriding custom language translations?

my site's language is persian and persian is a right-to-left language. Wordpress has a default installation package for this lang but for some cases like very bad translation for dashboard or default ...
1
vote
1answer
324 views

How to move theme directory but not plugins/uploads out of WordPress root directory?

I am trying to set up a few local multisite installs that will share the same themes folder, but have separate upload and plugin folders that will be in the usual places in wp-content. UPDATED: ...
1
vote
1answer
887 views

Control verbosity level of WP DEBUG?

I've been at a loss so far and so I thought I'd pose the question: Is there a way to modify the verbosity level of the WP debug.log via wp-config.php or elsewhere? Just an fyi, here is what I have in ...
1
vote
1answer
256 views

Accessing two databases

I have two databases on my server, and wanted to know is there a way to access both databases from wordpress? My thought is adding the second set of credentials to the wp-config.php.
1
vote
5answers
852 views

Moving WP from local server to live, error establishing a db connection

Not sure what's going on here 'cos I've done it already a couple of times and it always worked. Basically I'm moving a testing site from my local machine (MAMP) to a live server by: zipping the ...
1
vote
1answer
26 views

html lang=“” instead of lang=“en-us” - why?

In a few installations of wordpress, the beginning of the html tag looks like <html lang="en-US" ... despite that in wp-config no language is specified. define('WPLANG', ''); Hovever, in one ...
1
vote
1answer
674 views

Bad Request (Invalid Hostname) on working server, database problem

I have a local server up using EasyPHP. I know its working because I have a default wordpress install running and up on my brower. I have a full site which I also know I have working because when I ...
1
vote
1answer
843 views

Error uploading files bigger than 58 MB

For uploading files bigger than 58meg I get HTTP error. or IO error when using media uploader or 500 Internal Server Error when using browser uploader in WordPress v3.5.1 Multisite . It seems to get ...
1
vote
1answer
1k views

Accessing WordPress MySQL Database via Data Connection in Visual Studio 2010 using C#

So I've Googled and followed countless tutorials, read documentation on MySQL, Visual Studio, WordPress, and Plesk. I try to leave posting on this site as the final option and it seems it has come to ...