Stopping Spam in Wordpress

No Comments »

Spam has always been a nuisance and affects many web applications on the internet. It didn’t take long for my blogs to receive some spam comments when I migrated to WordPress. Fortunately, WordPress and its community make several plugins available to counter these spam attacks.

By default WordPress comes with the Akismet plugin which checks your comments against the Akismet web service to see if they look like spam or not. However, to activate this plugin you need a WordPress API key which can be obtained by registering to WordPress.com.

Not wanting to register with WordPress.com, I went to see what the WordPress community had to offer. I decided to use Wp-SpamFree, which was one of the more popular and higher rated plugin. The plugin blocks spam without using CAPTCHA or challenge questions, and once activated the plugin will display the number of blocked spams on the dashboard.

WP-SpamFree

Other plugins which I use are mention in my previous blog: WordPress Plugins.

Permalinks in WordPress

No Comments »

By default WordPress uses web URLs which have question marks and lots of numbers in them that looks ugly. e.g. http://example.com/?p=123

WordPress offers you the ability to create custom URL structure for your permalinks and archives, which improves the readability, and forward-compatibility of your links e.g. http://example.com/category/post-name or http://example.com/year/month/day/post-name. To enable permalinks you first need to enable mod_rewrite for Apache. In Ubuntu execute the following:

$ sudo a2enmod rewrite

In the Apache configuration file, the FollowSymLinks option needs to be enabled and the FileInfo needs to be allowed for the WordPress’s home directory.

<Directory /var/www/wordpress>
    Options FollowSymLinks
    AllowOverride FileInfo
    allow from all
</Directory>

Create a .htaccess file inside the WordPress’s home directory and set read/write permission to it.

$ cd /var/www/wordpress
$ touch .htaccess
$ chmod 666 .htaccess

In the WordPress Dashboard navigate to “Settings” > “Permalinks”

WordPress Permalink

Specific the URL structure which you desire, and click on the “Save Changes” button.

For security purposes remove the write permisson on the .htaccess file

$ chmod 644 .htaccess

WordPress Plugins

1 Comment »

Currently the WordPress community provides 2200+ plugins for WordPress users to install. Most plugins are easy to install while some require you to do some simple PHP coding afterwards.

To install a typical plugin, download the plugin and extract it into the wp-content/plugins folder of the WordPress root folder. In the Dashboard, click on the “Plugins” link and the “Activate” link to activate your plugin.

WordPress Plugins

Plugins which I installed

Broken Link Checker: This plugin is will monitor your blog looking for broken links and let you know if any are found.

This requires the CURL library to be installed for PHP, otherwise an error will occur: Fatal error: Call to undefined function curl_init().

To install CURL library for Ubuntu:
$ sudo apt-get install php5-curl

Link Summarizer: This plugin produces a list of all the links you referred to in a posting. You can exclude links from the summary by specifying regular expressions for links that shouldn’t show up. For example, the regular expression I used to ignore links to the images of my blogs:

^http:\/\/.*\.vincentkong\.com\/.*\.(gif|png|jpg)$

Wordbook: This plugin allows you to cross-post your blogs to your Facebook Mini-Feed. Your Facebook profile will also show your most recent blog posts. This works similar to importing your blog’s RSS feed with Facebook Notes, but with some advantages as described in the Wordbook FAQ.

WP-ShortStat: WP-ShortStat is a litte statistics plugin for WordPress.

WP-Table: This plugin creates and manages tables for WordPress.

WordPress Quickstart Guide

, No Comments »

WordPress is an open source blog publishing system written in PHP with a MySQL database.

Installing WordPress

Download and the latest release of WordPress.

$ wget http://wordpress.org/latest.tar.gz

Extracting the file will create a new directory wordpress, move all the files into the a web server’s public HTML directory.

$ tar -zxvf latest.tar.gz
$ mv wordpress/* /var/www/wordpress

Create a MySQL database and user for Wordpress

mysql> CREATE DATABASE databasename;
mysql> GRANT ALL PRIVILEGES ON databasename.* TO 'username'@'localhost' IDENTIFIED BY 'password';

Create a wp-config.php file and modify it to specific your WordPress settings.

$ cp wp-config-sample.php wp-config.php
$ nano wp-config.php

define('DB_NAME', 'putyourdbnamehere');
define('DB_USER', 'usernamehere');
define('DB_PASSWORD', 'yourpasswordhere');
define('DB_HOST', 'localhost');

The database character set, normally should not be changed.
define('DB_CHARSET', 'utf8');

The database collation should normally be left blank.
define('DB_COLLATE', '');

In version 2.5 WordPress introduced a new optional entry called SECRET_KEY, which enables better encryption of information stored in the user’s cookies.

define('SECRET_KEY', 'put your unique phrase here');

It’s recommend to change the value of the SECRET_KEY to a unique phrase. To help generate a unique phrase visit the WordPress secret key generation site. For more information on the SECRET_KEY refer to the Editing wp-config.php page.

Run the install script by pointing your browser to the URL of your website (e.g http://www.vincentkong.com).

WordPress Welcome

After the installation has been successful, it’s recommend that you immediately login and change the randomly generated password.

WordPress Success

Finish Migrating to WordPress

No Comments »

After changing some settings, adding some plugins, tweaking the theme, and reorganizing the content. I have finally finish the migration to WordPress. However to not forget how my previous website looks like I have taken a screen shot.

vincentkong.com using Drupal

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in