Posted on Leave a comment

How To Change Categories’ URLs In WordPress

Changing URL is something you shouldn’t do frequently because of SEO. However, there are times you need to change the URL to reflect the content of your pages/posts.

In WordPress, you can choose to include the category in the URL. For example, my permalink structure is:

category in permalink
category in permalink

Then my post URL will container the category. For example, I have an article in the World News category. The URL of that post will be

How To Change Categories' URLs In WordPress 1

Now, for example, I would like the change the world-news into breaking-news. How would I do that?

Let me show you how.

How to change the category in your post URL

First, you need to go to Posts->Categories. You will see your category listed there:

List of categories
List of categories

As you can see, the category we want to change is World News. If you notice at the right of World News row, there is field called slug. This is what displays in the URL of every posts of that category.

Now, if we want to change world-news to breaking-news, simply change the slug to breaking-news.

Step 1: Click on Quick Edit link under World News

Quick Edit category
Quick Edit category

Step 2: Change the slug to breaking-news.

Remember, you don’t need to change the name to Breaking News to update the URL. Changing the slug only is sufficient.

How To Change Categories' URLs In WordPress 2

Step 3: Hit the Update Category button

Now, if I view the URL of the post mentioned at the beginning of the article, I can see the new category slug:

How To Change Categories' URLs In WordPress 3

So, that’s how you change the category name in the URL. However, it is not recommended to change the URL of any pages/posts frequently because it will take time for search engines to update your new URL. After changing the URL, you also should do a redirect from the old url to the new URL to make sure when the visitors go to the old URL, they will get redirected to the new URL, not a 404 page.

Posted on 11 Comments

Extract List Of Unique Words From a Book, Article (Supports .txt, .pdf format)

As an ESL, I usually wonder: “how many words I need to know to speak English well?”. I read somewhere that you don’t need more than 2,000 words to carry out 99% of daily conversations. 2,000 words don’t seem to be a lot and if I can learn 10 words a day, I can be conversational in any language in just 200 days (less than a year).

So, what if I want to enjoy the novels, books in English, how many words I need to know.

I doubt the number would be a lot more than 2,000 words.

So I made a tool to read all the text in a book (you can select more than one book in .pdf or .txt format) and it will export all the words in that book into a table.

Here are some results:

Adventures of Huckleberry Finn

Extract List Of Unique Words From a Book, Article (Supports .txt, .pdf format) 4

As you can see at the top, there are 6461 different words in this book.

Wuthering Heights

Extract List Of Unique Words From a Book, Article (Supports .txt, .pdf format) 5

for Wuthering Heights, you need to know 9,456 words.

That’s a lot of words.

The numbers aren’t 100% correct. There are some gibberish such as website address, two letter (like country codes) may get in the list. However, you can roughly estimate that there are 95% of the numbers are real words.

I find that this is a good way to quickly find out new words that I don’t know. I can click on the words to get the definition (if available) on the right.

You can download the program here for free. If you have any suggestion, please let me know.

Download Word Extraction app here

Posted on Leave a comment

[With Pictures] How To Install WordPress Themes, Plugins In CPanel Step By Step

[With Pictures] How To Install WordPress Themes, Plugins In CPanel Step By Step 6

Installing WordPress themes, plugins seems to be a simple task, even for beginner. However, due to the fact that there are many hosting providers out there and each of them have a different configuration, installing a new theme or plugin on your WordPress may not be straightforward.

Most of the time, you can install a theme or plugin by uploading the .zip file inside your site dashboard.

To install a plugin you may follow the following steps:

  1. Go to Plugins->Add New
  2. Click on Upload Plugin
  3. Select your plugin .zip file and click on Install now
  4. Wait for the installation process to complete and click on Activate Plugin

The same steps can be applied to installing a theme, though, there are some differences:

  1. Go to Appearance->Themes
  2. Click on Add new
  3. Click on Upload Theme
  4. Select your theme .zip file and click on Install now
  5. Wait for the installation process to complete and click on Activate Theme

However, there is a very common problem WordPress users have when using this method is the hosting provider may put a limit on file upload size, which, less than the size of the plugin’s or theme’s zip file.

For example, your host has a 2MB limit on file upload and your theme zip file is 3MB.

In this case, uploading the theme inside your dashboard will result in a failure.

Fortunately, if your host have CPanel, you can install the plugin/theme easily.

How to install WordPress plugins/themes using CPanel

What are the benefits of installing plugins, themes using CPanel?

The biggest benefit is you don’t have to worry about upload file limit. Secondly, you can upload a zip file and then extract in on your site later. This feature can save you a lot of time in comparison to using FTP. When uploading the plugins/themes via FTP, you cannot upload a zip file then upload in the FTP client. If you install the plugin/theme using FTP, you need to extract it first before uploading. If your theme/plugin has a lot of files (even though they may be small), you will have to wait for a very long time.

Now let’s get started with installing plugins/themes using CPanel

Step 1: Login to your CPanel

The first thing is to to login to your CPanel. In the image below, I’m in HostGator CPanel. Your CPanel dashboard may look a bit different if your CPanel version is different than mine. However, you will have no problem finding File Manager. You can press Ctrl + F ( or Command + F if you are on a Mac) and type in “File Manager” to locate it.

Login to your CPanel and locate File Manager
Login to your CPanel and locate File Manager

Step 2: Go to File Manager and locate your site’s folder

Your site’s folder usually have the same name as your domain name. In the picture below, I’m going to the folder of my site called excelautocomplete.com

Go to file manager and locate your site's folder
Go to file manager and locate your site’s folder

Step 3: Go to wp-content/plugins or wp-content/themes

Now, if you double click on your site’s folder, you will see something similar to this. There are many files and folders but you only need to pay attention to one folder called wp-content

Locate wp-content folder
Locate wp-content folder

Double click on that folder you will see a list of folders. Here, you will see two folders with the following names:

  1. themes
  2. plugins

The names of those folders are self-explanatory. If you want to install a plugin, click on plugins folder. If you want to install a theme, click on themes folder. I’m going to install a theme so I’m going to click on the themes folder. You will see that there are one or more folders inside. The number of folders inside themes/plugins folder depends on the number of themes/plugin you have.

plugins and themes folder inside wp-content
plugins and themes folder inside wp-content

Step 4: Upload your zip file

Now, I’m inside the themes folder. I can start uploading the theme zip file. Please make sure your theme is in a zip file. If you have extracted it to a folder, please compress it back to a zip file.

Now, click on the upload button in your CPanel

Start uploading theme zip file
Start uploading theme zip file

You will see a new tab opened:

Select your zip file to start uploading
Select your zip file to start uploading

Now, select your theme .zip file and wait until the upload complete:

select theme file to upload
select theme file to upload

In this example, I’m select the theme sydney.

Upload theme complete
Upload theme complete

The upload is complete. Now, we go back to the theme folder and hit reload button to see the zip file:

Reload themes folder
Reload themes folder

After that, you should see the zip file appears

[With Pictures] How To Install WordPress Themes, Plugins In CPanel Step By Step 7

Step 6: Extract your zip file

We can now right click on the zip file to see the context menu and select the option to extract the file.

Extract the theme zip file
Extract the theme zip file

[With Pictures] How To Install WordPress Themes, Plugins In CPanel Step By Step 8

[With Pictures] How To Install WordPress Themes, Plugins In CPanel Step By Step 9

Wait until the decompression completes,  now, if you click on the reload link, you will see your new theme folder appears:

[With Pictures] How To Install WordPress Themes, Plugins In CPanel Step By Step 10

You can (and should) delete the zip file. To do that, simply click on that file (single click) and select the delete action at the top.

Step 7: Go to your site’s dashboard to activate the plugin/theme

Now, your theme is installed. The last thing to do is to go to your dashboard and activate it. Go to Appearance->Themes. You will see the new theme appears:

New theme
New theme

You can hover on that theme and see the option to activate it:

[With Pictures] How To Install WordPress Themes, Plugins In CPanel Step By Step 11

Now, you have your new theme installed and activated. You can do the same with a plugin. However, instead of going to Appearance->Themes, you need to click on Plugins and find the new plugin in your list of plugins and click on Activate.

So, that’s how you install plugins/themes using CPanel. If you have any questions, please leave a comment below.

Thanks for reading!

 

Posted on Leave a comment

Grunt-contrib-sass and grunt-sass hang on watch – What is the alternative?

Configuring grunt to compile sass, scss file is quite simple and straightforward. However, as I use the recent version 1.01, the task just hangs without doing any compiling. I’ve tried using grunt-contrib-sass and grunt-sass without any luck.

What’s the solution

I’ve spent hours searching for solution on Google but couldn’t find one. So, I came up with an idea: why do I have to rely on grunt? Using sass directly in the command line is very simple and the task completes quite quickly.

How do I set up?

The setup is very simple, you can write the following code in the command line to compile a sass/scss file to css file.

sass --watch source-file1:destination-file1 source-file2:destination-file2

As you can see, you can pass multiple source:destination pairs

Now, as your source files change, sass will compile to the destination file automatically.

What if I want to compress the destination files?

If you want to minify the destination files, simply put –style compressed option into the command

sass --watch --style compressed source-file1:destination-file1 source-file2:destination-file2

Now, your destination files will be minified.

I want to watch a folder with many files, what should I do?

Honestly, if you watch changes from a folder contains many files, sass may take a long time to compile to .css file. This is why I only watch changes on a few .scss files which import other partials. When I want to compile to .css file, I simply go to that file and add a space.

This strategy will save your computer from compiling sass all the time. On old computer, you may hear the fans’ noise constantly.