snippets

How to hide Nginx version number in headers and errors pages

In default Nginx configuration, the server sends HTTP Header with the information of Nginx version number of the Server. The HTTP response header “Server” displays the version number of the server. This information can be used by hackers to try to exploit any vulnerabilities in the Nginx, specially if you are running an older version …

How to hide Nginx version number in headers and errors pages Read More »

How to get size of BLOB in MySQL

Recently I wanted to get the size of the data stored in the BLOB field of a MySQL table. BLOB is a field which can be used to store variable amount of data. There is a simple MySQL String function, to find the size of BLOB data, OCTET_LENGTH. This function returns the length of BLOB …

How to get size of BLOB in MySQL Read More »

How to apply a function to every array element in PHP

I often come across situations in which I need to apply some function to every element of an array in PHP. For example, to sanitize the user input, function like htmlentities can be used. We can easily use this function on a single variable or a single dimension array by simply applying the function or …

How to apply a function to every array element in PHP Read More »

How to remove WordPress version parameter from JS and CSS files

In my last post I mentioned how we can remove WordPress version number from the page source and RSS feeds. However, they are not the only places where we can identify the WordPress version number. Many CSS and JS files in the WordPress also have the WordPress version number appended to their source. In this …

How to remove WordPress version parameter from JS and CSS files Read More »

How to remove WordPress version number

By default WordPress adds a meta tag which displays the WordPress version number that your WordPress site is running on. The version number is added just for tracking. This information can be useful to hacker to identify which version of WordPress you are running. If you are not running the latest version of WordPress the …

How to remove WordPress version number Read More »