MySQL Logging – How to log all mysql queries, errors and slow queries on Cpanel Servers

Logging slow queries and mysql errors is important for ease of troubleshooting mysql issues but if you also need to log every single mysql query executed by the server for troubleshooting purposes then you need to add an extra line to your mysql configuration file. First and foremost, for this you will need to have root ssh access to your server. In addition to the regular mysql configurations, this is how I do my mysql logging. 1. Once logged...

Read More Here >>

Hiding Part of a WordPress Template Based on the Type of Template Being Used

Here is a nifty piece of code you can use in the case you need to hide something or show something on a wordpress template that you have assigned to your page. So in the instance you needed to hide the navigation menu on a certain type of page within your site you would literally add a few lines of code as the wordpress codex already provides a function for determining if the page is using a certain type of template. (see: is_page_template ) Lets...

Read More Here >>

[solved] .htaccess not working in wordpress sub directory

Today, one of my clients mentioned that his rest api was not working and was returning 404 errors and the iphone app was broken due to the 404 errors. As he is running wordpress the immediate thought was that wordpress was overriding something and showing 404 errors inside his api directory (usually 404 errors indicate that the folder/file does not exist but we checked and the folder was there). Here is a visual example of the issue. When i opened up...

Read More Here >>

How to Secure WordPress

WordPress IS NOT SAFE…..”out of the box” and If you are willing and daring enough to DIY it, then the checklist below is  what you need to do in order to make your wordpress install more secure. Server security will never ever be 100% bullet proof but the methods below will provide a heightened level of security for wordpress and  will deter casual hackers and their automated robots but at the same without causing too much inconvenience...

Read More Here >>

Find and Replace Data in all Columns and Tables in MySQL

Here is a quick way to find and replace data in a Mysql database across all columns and tables at once. I use this method when I am launching a new wordpress site taking it from dev platform over to production (i would just search and replace the wordpress localhost name with the wordpress production hostname) Usually to do cross table search and replace requires some complex sql queries which opens you up to the possibility of errors. This way is...

Read More Here >>
NAVIGATION MENU