Things to do after installing RunCloud

Some few things I do after connecting a server to runcloud. Disable ipv6 Create /etc/sysctl.d/60-ipv6-disable.conf with the following contents: net.ipv6.conf.all.disable_ipv6 = 1 net.ipv6.conf.default.disable_ipv6 = 1 net.ipv6.conf.lo.disable_ipv6 = 1 Run service procps restart MySQL Create /etc/mysql/conf.d/custom_config.cnf with the following contents: [mysqld]

Add headers to certain directories in Nginx under RunCloud

Sometimes we wants to add custom http headers to certain directories and their files. For example: I wanted to add X-Robots-Tag header to some some private directories so it does not get indexed. I’ve tried many methods in the internet

My Sublime Text 3 settings & packages

Few days ago I changed my default text editor from Notepad++ to Sublime Text. The main reason I switched because I wanted to improve my development workflow and I must admit it very much did indeed. I have been using

Use WP Smush without slowing down WordPress

I use WP Smush to compress images in WordPress. But lately the plugin became extremely slow because of excessive database queries. The media library takes 10 seconds to open while the plugin is active but takes only 2 seconds when

WP Rocket Hooks

after_rocket_clean_post action is fired after clear cache of a post. add_action( ‘after_rocket_clean_post’, function( $post ) { if ( $post->post_name == ‘foo’ ) { rocket_clean_files( ‘’ ); } }); after_rocket_clean_domain action is fired after clear cache of whole domain (clear all

WP Smush using WP-CLI

If you use WP Smush then you should know that you can use it via WP-CLI too. This feature became available since the version 3.1 Here are some commands: /** * Optimize image. * * ## OPTIONS * * [–type=<type>]

Remove any action or filter in WordPress

Sometimes we need to remove actions or filters added via Themes or Plugins. To remove a action or filter check’s guide. But sometimes that is not enough, sometimes some hooks are too stubborn to remove. In that case use

Delete comment replies when deleting comment in WordPress

By default when a comment is deleted, WordPress does not delete the replies of that comment. With this function whenever comment is deleted, its replies will be automatically deleted. /** * Delete comment replies when deleting comment. */ add_action( ‘delete_comment’,

Useful Linux Commands

Run command without output command > /dev/null 2>&1 Run command in background without output nohup command > /dev/null 2>&1 & List all files recursively find -type f -printf “%[email protected] %p\n” | cut -d\ -f2- Search for specific file recursively find

Cloudflare optimal & recommended settings

If you Google “cloudflare settings for wordpress” you will find a lot people giving tutorials how to speed up sites using cloudflare. Let me tell you all of them are bullshit. The more you optimize cloudflare the more problems you’re

Useful Yoast Hacks

I use Yoast SEO on all of my wordpress setup. Here are some hacks that I use for it. Disable Yoast JSON-LD Completely add_filter( ‘wpseo_json_ld_output’, ‘__return_false’ ); Noindex paginated pages Since the version 7.0 Yoast SEO started paginated pages indexation

Stop generating additional image sizes in WordPress

Whenever you upload image to media library, WordPress will automatically generate additional images with 3 default image sizes and store them separately. Then your theme and plugins will generate some additional image sizes too. In my case total of 13

How I put a stop to spam in Contact Form 7

Contact Form 7 Limit Submissions: Unfortunately there was no available plugins or codes to limit the submissions in Contact Form 7, so I built one. This is how I built it. Create Table in Database: First I created a table

Useful Nginx Hacks

The Regular Expression translates to: “rewrite all URLs without any ‘.’ (dot) in them that don’t end with a ‘/’ to the URI + ‘/’” Or simply: “If the URI doesn’t have a period and does not end with a