Category Archives: WordPress

How to change WordPress username

By default when you install WordPress, the username is “admin”. If someone is trying to hack into your site the first username they would try is “admin”, and if you use “admin” all they have to now do is guess your password. So, it is highly recommended that you never use “admin” as the username used to login into WordPress. You can choose a different username while first installing WordPress. However, you cannot change your username once created.

You can change the username by running queries in the database or use different plugins for it. However, there is a much simpler way to change your username. In this post lets see how we can change the “admin” username (you can use similar steps for any other username).
Read more »

How to add CSS classes to WordPress menu item

Recently I wanted to add some customization to some of my menu items. So I decided to add a CSS class to those particular menu items. I could modify my theme code and add some custom functions to do that. However, I first decided to explore the WordPress options and see if there was already some thing built in to do this. I found that there is an easy way to do this. This is normally a hidden option and in this post I will tell you how we can easily do that.

How to add CSS classes to WordPress menu item
1. Go to Appearance -> Menus in your sidebar
2. On the top right of the screen click the “Screen Options” tab
3. Check the “CSS Classes” option in the Screen Options tab. You don’t need to save, the changes will be visible immediately
4. Add or open up the menu item you wish to add the CSS Classes to. Now you will see a field that says “CSS Classes (optional)”. Add the CSS classes there
5. Click “Save Menu” to save your changes

These steps should work with WordPress 3.0+.

WordPress $ is not defined even if jQuery is loaded

Many times while using WordPress, if we try to use “$” to access jQuery, we get an error the “$ is not defined”. This happens because the jQuery library which is included in WordPress loads in “no conflict” mode. In the no conflict mode jQuery returns the control of “$”, and it is no longer accessible as function, variable or alias for jQuery. WordPress does this in order to prevent compatibility problems with other JavaScript libraries that can be loaded.

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 post I will show how we can remove the version number from them too.

We can use one of the following 2 methods. Just added the code for one of the below methods in your theme’s functions.php file. The first method removes the “ver” parameter from all the enqueued CSS and JS files. The 2nd method removes the “ver” parameter only if its value matches the WordPress version number.
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 hackers can try to target the known vulnerabilities in that version to hack your site.

Note: This is just one way to identify the version. Also, even if this information is not available hackers might still try to hack it using other ways. So it is recommended that you always have the most up to date version of WordPress running.

In this post I will show you some wrong and right ways to remove this information.
Read more »

Follow

Get every new post delivered to your Inbox

Join other followers:

%d bloggers like this: