Category Archives: Wordpress

Add admin user to WordPress with SQL statements

Step 1 Add the user who is going to be an Administrator

INSERT INTO wp_users (ID, user_login, user_pass, user_nicename, user_email, user_url, user_registered, user_activation_key, user_status, display_name) VALUES ('4', 'demo', MD5('demo'), 'Your Name', '', '','2011-06-07 00:00:00', '', '0', 'Your Name');

Step 2 Give the user the appropriate rights

INSERT INTO wp_usermeta (umeta_id, user_id, meta_key, meta_value) VALUES (NULL, '4','wp_capabilities', 'a:1:{s:13:"administrator";s:1:"1";}');

INSERT INTO wp_usermeta (umeta_id, user_id, meta_key, meta_value) VALUES (NULL, '4','wp_user_level', '10');


Move to a WordPress https website from http

Wordpress https

WordPress https

Google recently announced that it has started using HTTPS as a ranking signal. So to improve your SEO results you can choose to ONLY use HTTPS for your WordPress site. For this to work you have to have a valid certificate in place (obviously).

Setting up a “SSL only” blog takes two steps.

1. Update your .htaccess file

Go to your WordPress installation folder and edit the .htaccess file in there. Below the line

add the following two lines:

The two rules above will take care for the redirection (in case the user visited your http site) to the https site.

2. Update the WordPress blog settings

Go to the dashboard of your WordPress site and navigate to Settings -> General . Change the WordPress Address and Site Address to use the htpps URL:

Wordpress https

WordPress https

Ok that is all. Your visitors will now always be redirected to the https version of your website.


WordPress remove the Editor option below Apearance

Using the WordPress Editor is a good way to mess up your WordPress installation. Inexperienced users can use this Editor to take the website offline by making one single typo. If you don’t want this to happen you can disable the editor. Add the line below to your wp-config.php:



Contact Form 7 restrict access

In its default settings, Contact Form 7 allows all users except subscriber users to have access to the administration panel; but allows only administrator and editor users to edit contact forms. You might feel that you would want to change this setting to restrict access even more, so I will show you how to do this in this article.

For example, let’s change access to allow only administrator users access and editing rights. You can do this by editing your wp-config.php and inserting these lines:


WordPress behind a proxy

To configure wordpress to use your proxy add the following settings to the wp-config.php file (add the appropriate values between the quotes):



WordPress Optimization

Edit your .htaccess file and add the line

To optimize your WordPress installation add the following to your theme (not the WordPress) Functions.php at the very top:

Line 1 will remove the WordPress identifier

Line 2 will remove the Windows Live Writer support for downloading css

Line 3 will remove

Line 4 and 5 will remove the secondary WordPress feeds


WordPress keeps track of your post revisions. To disable this feature place the following line in your wp-config.php

To keep at most three revisions use