38
votes
What security concerns should I have when setting FS_METHOD to "direct" in wp-config?
What's the risk?
On a poorly configured shared host, every customer's PHP will execute as the same user (let's say apache for discussion). This setup is surprisingly common.
If you're on such a ...
38
votes
Accepted
Cookies in Multisite network where sites have their own domain name?
First clear your browser's cache (including cookies), and your server's cache (e.g. cache plugins). Then set the following in your wp-config.php file:
define('ADMIN_COOKIE_PATH', '/');
define('...
34
votes
Site Redirecting to wp-signup.php
For me it was changing old domain entries in database tables wp_blogs and wp_site to the new domain of the multisite's main domain.
I haven't done this after the migration to a new domain.
23
votes
Is it possible to change the log file location for WP_DEBUG_LOG?
It seems most of the answers here are not true anymore for WP version 5.1 and above since this change: https://make.wordpress.org/core/2019/01/23/miscellaneous-developer-focused-changes-in-5-1/
You ...
19
votes
Should I disable WP_CRON and trigger wp-cron.php from the server?
There is no downside for running WP CRON using the server's cron jobs. In fact this is the recommended practice.
According to Official WordPress Plugin Development Document:
WP-Cron does not run ...
17
votes
What's the difference between WP_MEMORY_LIMIT and WP_MAX_MEMORY_LIMIT?
WordPress tells us:
the WP_MEMORY_LIMIT option allows you to specify the maximum amount of
memory that can be consumed by PHP. This setting may be necessary in
the event you receive a message ...
16
votes
Disable SSL / HTTPS for wordpress
Check your wp-config.php file for lines like:
define( 'WP_SITEURL', 'https://example.com' );
define( 'WP_HOME', 'https://example.com' );
Also check your database's {prefix}_options table:
SELECT ...
15
votes
Accepted
Please explain how Wordpress works with MySQL character set and collation at a low level
There are two defines in wp-config.php of WordPress website:
define('DB_CHARSET', 'utf8');
define('DB_COLLATE', '');
There are several things which are most commonly misunderstood. Names
of ...
14
votes
Which one does Wordpress prioritize when it comes to php.ini, wp-config and .htaccess?
It's not clear from your question what you are changing in each of these files, but I presume in each case it is the upload_max_filesize PHP setting.
In general, settings will be applied in this ...
11
votes
How to use live images on local install?
The best way to do it is to use URL Rewrites.
This way you'll not have to do any change before uploading CODE to your server back again.
Custom rules for localhost:
Try the following CODE in your ....
10
votes
Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 20480 bytes)
Add the following at the top of wp-config.php:
ini_set('memory_limit','128M');
Although you should use WP_MEMORY_LIMIT when you can, we see in /wp-includes/default-constants.php that Wordpress doesn'...
9
votes
Cookies in Multisite network where sites have their own domain name?
Using WordPress version 4.9.4.
I was getting the cookie error and looked through various help options and eventually solved it by using a parts of Scott's fix. (Note: I didn't do any cookie cache ...
9
votes
Accepted
If I change the salt keys in my wp-config will all passwords break?
No the passwords won't break (those are in the database and aren't changed by changing the salt). However all logged-in users will have to login again.
More on Salts here.
Note: Updating your ...
9
votes
Accepted
How can I change preview URL?
You can do something like this, add to functions.php
add_filter( 'preview_post_link', 'the_preview_fix' );
function the_preview_fix() {
$slug = basename(get_permalink());
return "http://www....
8
votes
COOKIE_DOMAIN setting confusion
I have been struggling with using the multisite domains of native 4.x wordpress.
Despite finding references, saying these lines corrected the error, neither of these setting worked:
//define('...
8
votes
What's the difference between WP_MEMORY_LIMIT and WP_MAX_MEMORY_LIMIT?
The WP_MEMORY_LIMIT is the default limit set in the front-end, but it can be raised up to WP_MAX_MEMORY_LIMIT in wp-admin pages, as well as certain other functions such as image manipulation.
In ...
8
votes
Accepted
WP_MEMORY_LIMIT didn't work in wp-config
Need to set both the constants before ABSPATH is defined. Right after this line in wp-config.php
define( 'WP_DEBUG_LOG', true );
7
votes
Notice: Constant WP_POST_REVISIONS already defined
I have the same problem before.
I put WP_POST_REVISIONS in the end of wp-config.php file and it didn't work correctly.
You should put your codes before defining ABSPATH and before this line:
/* ...
7
votes
Disable SSL / HTTPS for wordpress
You can modify .htaccess file:
RewriteEngine On
RewriteCond %{HTTPS} on
RewriteRule ^ http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L,NE]
6
votes
Is it possible to change the log file location for WP_DEBUG_LOG?
Times change, and so do correct answers to technical questions.
The current answer as of late 2019 is simple. When defining the WP_DEBUG_LOG "constant" in wp-config.php, you can now provide a path ...
6
votes
Why is WordPress Multisite redirecting to wp-signup.php and how to fix it?
I can't comment so I'm leaving this answer. As a follow up to the fantastic research done by @Borislav there is another SE thread that is related, with several potential fixes:
Site Redirecting to wp-...
5
votes
Accepted
How does the "authentication unique keys and salts" feature work?
Basically, they're hashing salts. They're used to make the results of hashing much less predictable. See https://en.wikipedia.org/wiki/Salt_(cryptography) for info on salts.
AUTH is used for the /wp-...
5
votes
WP-Admin not working properly at Wordpress multisite with subdirectories
If you installed WordPress Multisite starting with version 3.0 to 3.4.2, you've got the correct .htaccess file contents.
However, if you started with a newer version (3.5 or higher)—and I'm assuming ...
5
votes
Which one does Wordpress prioritize when it comes to php.ini, wp-config and .htaccess?
Basically all three files are taken into consideration.
WordPress/your server will check in the following order:
wp-config.php > .htaccess > php.ini
If something on a "higher level" (later in ...
5
votes
Accepted
Why is WordPress Multisite redirecting to wp-signup.php and how to fix it?
After many hours of debugging and despair, the problem is now solved. It turned out to be a very obscure thing.
The redirect is issued by the function ms_load_current_site_and_network() inside /wp-...
4
votes
Cookies in Multisite network where sites have their own domain name?
Finally after hours, literally, of troubleshooting I was able to get this resolved on the AWS Lightsail Bitnami Multisite Wordpress (WordPress 5.0.4) instance by performing the following:
Ensure the ...
4
votes
Accepted
Syntax of FS_CHMOD_DIR and FS_CHMOD_FILE
The basic syntax for define() is:
define ( $name, $value )
In the above definition, the value is:
( 0755 & ~ umask() )
The '&' (ampersand) is the 'And' bitwise operator,
the '~' (tilde) is ...
4
votes
Accepted
How can I resolve the php notice "Constant EMPTY_TRASH_DAYS already defined"
When defining any WordPress constants in wp-config.php you need to do it before this line:
require_once( ABSPATH . 'wp-settings.php' );
That line loads many of WordPress’s default constants, and if ...
4
votes
Accepted
How to change how long items are kept in the trash?
You can change that in wp-config (https://codex.wordpress.org/Editing_wp-config.php#Empty_Trash):
define( 'EMPTY_TRASH_DAYS', 1 ); // Integer is the amount of days
4
votes
What conditions must be met in order to upload .zip file to a multisite Wordpress installation?
The issue has nothing to do with the source code of a theme or plugin or with the configuration of Wordpress. It is:
a 6+ months old bug in File block in Gutenberg that narrows down to
a 4+ years old ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
wp-config × 404multisite × 53
database × 41
htaccess × 38
php × 32
security × 28
plugins × 26
configuration × 26
mysql × 20
errors × 19
wp-admin × 18
directory × 16
localhost × 16
site-url × 15
redirect × 14
options × 14
installation × 14
uploads × 13
themes × 12
functions × 10
customization × 10
memory × 10
subdomains × 9
urls × 8
migration × 8