Move WordPress from Root to Subfolder

Here is the instructions if we suppose that you intially installed your site into ROOT folder (in the link you provided it’s the method called Method II (With URL change) ). There are two important steps and between them your site may break but it’s not an issue : I) First you need to update … Read more

How to disable directory files from accessing?

If you are doing it for security purpose you can use following steps: add index.php file to each folder that you don’t want to show the content of. <?php // Just leave the index.php file blank And second way to reduce insecurity is to use if(!defined(‘ABSPATH’)){ exit; } inside every php files to no access … Read more

Automating WP application directory creation (domain name passed as a variable argument)

Ok, I just checked the WP CLI documentation. There are 3 important steps: Download WordPress: (I would use it with the options –path and –locale, but those are optional) wp core download Create a proper wp-config.php: wp config create –dbname=… –dbuser=… –dbpass=… –dbhost=… Install WordPress: wp core install –url=… –title=… –admin_user=… –admin_email=… Now there are … Read more

How to organize my js files

Generally speaking, combining all of the global scripts will boost performance, but so will enqueueing JS selectively – meaning if a script is only used on one CPT or template, you should only enqueue it there. Look into conditionally enqueueing JS in your functions.php. You can target specific sites by blog_id and target specific post … Read more

rm on a directory with millions of files

The data=writeback mount option deserves to be tried, in order to prevent journaling of the file system. This should be done only during the deletion time, there is a risk however if the server is being shutdown or rebooted during the delete operation. According to this page, Some applications show very significant speed improvement when … Read more

How to copy file preserving directory path in Linux?

The switch you need is –parents, e.g.: jim@prometheus:~$ cp –parents test/1/.moo test2/ jim@prometheus:~$ ls -la test2/ total 42 drwxr-xr-x 3 jim jim 72 2010-09-14 09:32 . drwxr-xr-x 356 jim jim 43136 2010-09-14 09:32 .. drwxr-xr-x 3 jim jim 72 2010-09-14 09:32 test jim@prometheus:~$ ls -la test2/test/1/.moo -rw-r–r– 1 jim jim 0 2010-09-14 09:32 test2/test/1/.moo

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)