1. Wordpress Tutorial
    1. Wordpress Installation
      1. Install Wordpress Manually
      2. Install via SiteGround Wizard
      3. Install via Softaculous
      4. Install via Fantastico
    2. Transfer Wordpress
    3. Create Website with WordPress
      1. Create a WordPress Post
      2. Add Multimedia to Post
      3. WordPress Categories
      4. WordPress Comments
      5. Install WordPress Themes
      6. Customize WordPress Themes
      7. Customize the Dashboard
      8. WordPress Banners Tutorial
    4. WordPress Updates
      1. WordPress Manual Update
      2. WordPress Auto Updates
      3. SiteGround Auto Update Tool
    5. WordPress Security
      1. WordPress Security Tutorial
      2. WordPress Spam Protection
      3. Change WordPress Username
      4. Remove Spam From Comments
    6. WordPress Administration
      1. WP-Cli Tutorial
      2. Reset WordPress Password
      3. WordPress Backup
      4. Change Admin Color Scheme
      5. WordPress Optimization
      6. Old WordPress Admin Look
    7. WordPress Plugins
      1. Install WordPress Plugins
      2. Clef Tutorial
      3. WordPress Shopping Cart
      4. WordPress Images
      5. FooBox Media Lightbox
      6. WordPress Classifieds Plugins
      7. BuddyPress as Community Site
      8. Recent Comments
      9. WP Classified plugin
      10. Another WP Classifieds Plugin
      11. Your Classified Ads
    8. Advanced Topics
      1. Send Emails Via SMTP
      2. WordPress With Real Cron Job
      3. Limit WordPress Heartbeat
      4. Disable Post Revisions
      5. WordPress SEO
      6. Translate WordPress
      7. WordPress Adsense
      8. WordPress The Loop
      9. Create a WordPress Theme
      10. Add Facebook Like Button
      11. Display Posts From Category
      12. Show Post Author
      13. Change WordPress URL
      14. Display Random Comment
      15. Hide Specific Category
      16. Remove WordPress User Bar
    9. WordPress Video Tutorials
      1. WordPress Installation Video
      2. WordPress Settings Video
      3. Change Password Video
      4. Edit Your Profile Video
      5. Change Header Video
      6. Manage Categories Video
      7. Add A Post Video
      8. Manage Users Video
      9. Manage Pages Video
      10. Manage Plugins Video
      11. Write Comments Video
      12. Update WordPress Video

Wordpress Tutorial2

In this tutorial we will provide you with detailed instructions on how to use WordPress to create and manage your site. WordPress can be used for both simple and complex websites. In our WordPress tutorial we have tried to cover all the basics and few advanced topics.

The Most Common Questions Answered in our WordPress Tutorial

Wordpress Installation

Install Wordpress Manually

In this tutorial we will provide you with detailed instructions on how to install WordPress on your web hosting account. Follow these guidelines if you want to perform a new, manual installation of the latest WordPress version.

STEP 1 Download the WordPress installation package

To start the installation process, first you need to download WordPress from it’s official download page. We recommend that you always download and install the latest stable version of WordPress.

wpi7

 

Once you click on the Download button for the latest WordPress version, the installation package will be saved to your hard disk. Locate the installation package that you’ve just downloaded and extract it to a new folder.

STEP 2 Upload the WordPress Files to Your Server

Now, you need to upload the extracted files and folders to your web server. The easiest way to upload the installation files is via FTP. For detailed information on how to upload files via FTP, please check our FTP Tutorial.

IMPORTANT!If you want your WordPress to be the main installation on your account and to be accessible through your main domain (i.e. www.mydomain.com), you need to upload the extracted files to your public_html folder.

Once the download is complete, extract the archive and upload it to your web hosting account. You can do that via FTP using a client application like Filezilla or via cPanel -> File Manager -> Upload file(s). If you want this WordPress installation to be main for your website, the files should reside in the public_html folder of your account. However, you can always make a subfolder (i.e. public_html/blog) if you want to run only part of your website on WordPress.

wpi8

STEP 3 Create a MySQL Database for WordPress to use

Now, you need to create a MySQL database and assign a user to it with full permissions. For detailed instructions on how to do that, please follow the steps described in our tutorial on How to Create MySQL Username and Database. Once you create your MySQL Database and User, make sure you write down the database name, database username and password you’ve just created. You will need those for the installation process.

wpi9

STEP 4 Go through the installation process

Now it’s time to navigate to your website to start with the installation process. If you have uploaded WordPress in your public_html directory you’ll need to go to https://yourdomain.com in your preferred browser. The first thing you will notice is a message, telling you that you don’t have a wp-config.php file and you should create one. Just click on the Create a Configuration File button to proceed.

wpi1

On this page you will see a message, asking you to prepare the necessary information for the installation. Since we already have this information, simply press the Go! button.

wpi2

Enter the details for your newly created MySQL database and press the Submit button

wpi3

WordPress will now check if your settings are correct. If you have entered all the necessary information, you will see a confirmation screen. Press the Run the Install button to proceed.

wpi4

On the next screen you will have to enter the information about your administrative username and the title of your new site. In addition, you can specify whether you’d want search engines to index your site or not. Once you fill in that information, press the Install WordPress button. Bear in mind, however, that you should specify a real email address. It can be later used in case you forget your password.

wpi5

THAT’S IT!Your new WordPress application is installed. You can use the Login In button to access your administrative backend and start posting in your new site.

wpi6

 

Install via SiteGround Wizard

To install WordPress using the SiteGround Wizard, first access your Customer Area. After you signup for our WordPress hosting package you will receive all the necessary information you need to login.

Once you login to your Customer Area for the first time, you will see a popup asking you if you want to have WordPress preinstalled on your account. Select that option and click on the Proceed button.

wpw1

The next page consists of two parts. In the first one, enter the login information for your new WordPress application.

wpw2

Next, pick one of the free WordPress themes available in the Wizard and click on the Submit button once again.

wpw3

Finally, you will see a quick summary of your WordPress installation, including from where to access your admin area, your username and your password.

wpw4

That’s it! You can now go to the front page of your site and check out the newly installed WordPress application.

Install via Softaculous

This tutorial is designed to show you how to use Softaculous to install a WordPress application to your site. It will take only few minutes and literally no advanced skills to have a fully functional WordPress instance in your hosting account.

First, login to your cPanel account and find the Softaculous icon under the “Software Services” section. It should be located in the lower part of your cPanel page, right under the “Domains” section.

image_1

Once you click on the Softaculous button, you will be redirected to the page where you have to chose the application you want to install. On the left side of your screen locate the “Blogs” category, click on it and then click on the “WordPress” link that will appear.

image_2

On the next page, press the Install button at the top of your screen to specify that you want to perform a brand new WordPress installation.

image_3

Finally, enter the required fields for your site – title, description, administrative username and password, administrative e-mail etc. and click on the “Install” button. Please note that by default Softaculous will install the application in a “wp” sub-folder. That being said, if you would like to be able to access the website only via your domain name you should delete the wp string from the “Directory” field. If you want to install the application in another sub-folder you should simply type it in the field.

image_4

WELL DONE!Your WordPress application is installed and ready to use. You can now login and start blogging!

Install via Fantastico

IMPORTANT!SiteGround no longer provides Fantastico autoinstaller on it servers. The new installer now available is Softaculous. In extensive tests it proved to match our outstanding service quality standards better, by providing more applications, faster version updates and better support. You can read more about why SiteGround now uses Softaculous in our blog.

For more information on how to install WordPress with just few clicks, please check our tutorial onHow to Install WordPress with Softaculous.

If your host does not support Fantastico, please check our WordPress Manual Installation tutorial.

Fantastico installation of WordPress

Please, follow the step-by-step guide below in order to activate WordPress on your hosting account:

STEP 1 Please, login to your CPanel and locate the Fantastico De Luxe icon:

1

STEP 2 Find and click the WordPress link.

2

STEP 3 Then choose New Installation:

3

STEP 4 Decide upon the location of your blog – if you would like to have it as your site front page, leave the directory box blank, otherwise fill in the appropriate folder name.

4

Next, fill in the administrator details and the e-mail account configuration then click the Install WordPress button.

STEP 5 A new confirmation page will be loaded for the installation. Click the Finish Installation button if no errors are reported.

5

If else you will have to go back and rectify the specified issues.

STEP 6 After completing the installation the final screen will load, providing you with the installation details. You will be able to e-mail the details to a specified address also in order to keep them for future reference.

6

WELL DONE!You have successfully installed the WordPress application!

How to Transfer WordPress

In this tutorial we will show you how to make a WordPress transfer to a new hosting platform. Whether you’re transferring from WordPress.com or from another regular hosting provider, here you will find detailed instructions on how to migrate WordPress to a new host.

Make a full WordPress Transfer

A WordPress migration from one hosting provider to another is an easy task if performed properly.

Basically, to make a WordPress migration from one host to another consists of three parts – moving the files, moving the database and reconfiguration (if needed).

Transfer WordPress Files

To move your files from one host to another you can use your favourite FTP client. For more information on how to use FTP, please check our FTP Tutorial. It will teach you how to move the files of your application first to your local computer and then to upload them on the new account. If your old host is using cPanel, you can use the File Manager tool to create a .ZIP archive of all your site files. You can then transfer it to your new host and extract it. This will save you time because transferring one big file is much faster than transferring thousands of small ones.

Migrate the WordPress Database

The second step is to move your database. First you need to export your database from the old hosting account. If it uses cPanel you can safely follow these instructions. If not, contact the support team of your previous hosting company in order to receive more information on how to export your database. After you have your data exported, create a new database on your new hosting account and import your content in it.

Reconfigure WordPress to work from the new server

Now, you have your files and database transferred. All you have to do is to reconfigure your WordPress application to work from the new place.

To do this, open the wp-config.php file in your WordPress root folder and locate the following lines:

define('DB_NAME', 'user_wrdp1');
/** MySQL database username */
define('DB_USER', 'user_wrdp1');
/** MySQL database password */
define('DB_PASSWORD', 'password');

You need to replace those values with your actual database, database username and password for it.

Now save this file and your WordPress site should be up and running from your new hosting account!

IMPORTANT!Note that if you change the domain name of your site additional reconfiguration is required.

INFORMATION!For more information on that matter check our tutorial on how to change a WordPress site URL

Transfer WordPress from wordpress.com

It is now possible to transfer your blog from WordPress.com to a stand-alone WordPress installation on your hosting account with just few clicks. To move your site, first login to your WordPress blog.Then go to the Tools menu and select Export. On the page that loads chose to export All content and click on the Download Export File button. Then download the .xml file on your computer.

word-1

This is all you need to do on your WordPress.com account. Now you need to import your information to your stand-alone WordPress installation. If you have one installed, login with your admin username and password. If you want to install a fresh WordPress application, check out our WordPress installation tutorial for more information on how to do this.Once you login, select the Tools menu from the left column and chose Import.

word-2

This page will show you the available sources you can import content from. Scroll down and select WordPress as an import type.

word-3

A popup will open asking you to install the WordPress Importer plugin. Click on the orange Install Now link to proceed.

word-4

Once the plugin files are downloaded, select the Activate Plugin & Run Importer link.

word-5

You will be redirected to the actual plugin page. Now click the Browse button, select the .xml file you have previously saved on your computer and click on the Upload file and import button.If the content which you want to migrate is quite large the corresponding web server’s timeout value can be reached before the data is fully copied. In this case you need to reupload the .xml file. The system keeps a record for the migrated content and will proceed with the remaining data. Repeat the procedure until you receive a confirmation that the process is successfully completed.

word-6

Since you will be inserting new posts and pages WordPress needs to know who will be their author. On this page you can either select an existing user as posts author, or you can create a new one for the imported data. Note that you should check the Download and Import file attachments checkbox if you want your photos and other attachment to be transferred too. Finally, click on the Submit button.

word-7

That’s it! Your data is now transferred from your WordPress.com account to your stand-alone WordPress application.

word-8

IMPORTANT!This will transfer only your content – posts, pages, media. All the plugins and themes you’ve used at WordPress.com are proprietary and not part of the transfer. You will have to choose a new theme and install all the necessary plugins you need additionally on your self-hosted WordPress site.

Migrate your WordPress data only

Sometimes you may want to transfer only the content from your WordPress site from one application to another (between two different WordPress installations). In such cases, WordPress provides you with an easy mechanism to move your posts, comments, users, attachments and other information with just few clicks. To do this, first login as administrator in your existing blog backend and select Tools -> Export from the left menu.

wrdp_cont_1

On this page chose whether you want your Posts, Pages and other available content transferred or you want all the content to be exported. For the purpose of this tutorial, we’ve chosen to move all the content. Then press the “Download Export File” button and save the .xml file to your computer.Now, login to your new WordPress installation and chose Tools -> Import from the left menu. On this page select “WordPress” in order to import content from your previous WordPress installation.

wrdp_cont_2

On the next page you have to select whether you want the new content to be posted with an existing author or under a new username. Make sure you check the “Download and import file attachments” checkbox. This will allow WordPress to move correctly your posts including all the photos and other media you’ve inserted into them.

wrdp_cont_3

Finally, press the Submit button and your content will be imported into your new WordPress application. That’s it! Your posts and media are now successfully migrated!

Create Website with WordPress

In this group of tutorials we will teach you the basics you need to know to make a simple WordPress site. Follow our tutorials in order to learn how to make a WordPress post, add images, video and sound to it, organize your posts in categories, manage comments and much more!

Create a WordPress Post

In this tutorial we will teach you the very basic thing you need to do with WordPress – creating posts. To begin, login to your site admin panel and go to Posts -> Add New.

pst1

On this page you will see the WordPress posts editor. The most important parts of this page are:

  • Post Title – enter the title of your post in this field. On your theme it will be shown above your content.
  • Post Content – you can use the WordPress WYSIWYG editor to add the actual content of your post. Note that it has two tabs – Visual (use the editor to format your text) and Text (add your HTML code directly).

pst2

Once you enter the content of your first WordPress post, you need to Publish it. Publishing brings your post to your actual website.

pst3

That’s it! You can now go to the front page of your site to check out the newly created blog post.

pst4

 

Add Multimedia to Post

Adding photos, videos and music to your posts is an easy task with WordPress. Let’s open the post you’ve created in our tutorial on how to create a WordPress post. Click on the text where you want to add the content and click on the Add Media button in the top left part of the editor.

am1

The WordPress Insert Media pop-up will appear. Click on the Select files button in the middle of the screen.

am2

Once pick the local file, WordPress will upload it and refresh the page depending on the file format. For the purpose of this tutorial we will add an image to the post. For images there are two things you should take care of. First, describe the image itself – enter its Alt tag, title for the link and optionally a caption. The caption will appear under the actual image on your front end.

am3

Once you do that, you need to specify the attachment settings of the image:

  • Alignment – How to align the image in your content. It depends on your actual theme how alignments will work on your site.
  • Link To – Select where to link the image to – the full size image file, the media page automatically created for each new attachment, custom URL or simply not to link it.
  • Size – When you upload an image, WordPress creates multiple copies of it in different sizes. Choose whether you want a thumbnail, medium sized image or the entire image added to your post.

am4

After you enter the information for you photo and choose how to visualize it in your post, click theInsert into post button. You will see the image added to your editor window.

am5

You can now update your post and go to the front end of your site. You will see the newly added image added to your post.

am62

Following the same instructions, you can add music and video to your posts.

WordPress Categories

WordPress categories are a very convenient way to organize your posts. You can have parent and child categories making hierarchical arrangement of your posts possible. In addition to that, one post can be into more than one category. This gives you a lot of flexibility to show exactly the posts you want, exactly the way you want them in widgets, menus or directly in your WordPress theme.

How to create WordPress categories

To creat new categories in WordPress, you need to access the Posts -> Catgories page first.wc1

 

On the left side of the page you will see a tab that allows you to create categories. Fill in the category name, its slug (will be used in the category URLs) and the Add New Category button. For the purpose of this tutorial we will make a new category named Family posts.wc2

 

That’s it, your first category is ready. Now, let’s make a sub-category of the Family posts one namedNephews. Fill in a name and slug the way you did with the first category but this time select Family posts as parent for the new category. Then, press Add New Category once more to save thew new sub-category.

wc3

How to assign posts to categories

Once you have the category structure created, you can add posts to categories. There are two ways you can do this. The first one is to open a particular post (or write a new one) and place a checkbox in the category you want to assign it to.

wc5

The second way is to bulk add posts to a category. To do this go to Posts -> All Posts. Next, select the posts you want to add to a category, click on the Bulk Actions tab, select Edit and finally press theApply button.wc6

 

Once you do that, you will few options you can adjust for those posts. One of them is the Categoriessection. Select the category you want to add those posts to and click on the Update button.

wc7

Now, the posts you’ve marked previously belong to the category you’ve chosen.

wc8

 

WordPress Comments

Comments are essential part of almost every WordPress website. It is important to have your comments free of spam and allowed under the pages or posts you want them to appear. In this tutorial we will provide you with detailed information on how to moderate and secure your comments, how to manage them per post or page, how to use external comment service and more.

What are Comments and Pingbacks

If comments are enabled(which they are by default) your visitors can share their thoughts on your content under your post. These are called comments. Comments are great for your website because they show you which of your content is becoming popular and what is your visitors opinion on what you write.

wc10

The way your comments are shown on your site depend on your WordPress comments settings and on the theme you’re currently using.

What are Pingbacks

When people cite or use your entire blog post linking to you, WordPress automatically sends a pingback to the content author. This way you can keep track on who is linking to you. In addition that’s a way of acknowledging someone’s authorship on certain content. You will see your pingbacks in the Comments section of your WordPress admin area. They will be listed amongst the regular comments. You can distinguish pingbacks from regular comments because the anchor text of the link to your site is automatically placed in square brackets by WordPress.

wcomm1

Configure Comments

The available settings for your comments are listed under Settings -> Discussion tab in your WordPress admin panel.

wcomm2

On this page, there are several important settings that you should change depending on your needs:

  • Allow people to post comments on new articles – this setting handles whether the comments under your new posts are enabled or disabled by default. Note that enabling or disabling comments under a particular post or page will overwrite this setting.
  • An administrator must always approve the comment – if you want to moderate each comment that enters your site before it goes live, enable this option. If you do so, you’ll have to activate new comments form the Comments page.
  • Show Avatars – by default, WordPress will link the commenter’s email address to his/hers avatar in Gravatar if such is present. With this option, you can either hide or show avatars next to your comments.

Protect Comments from Spam with Akismet

Setting up Akismet for your WordPress site is one of the first things you should do. Spam is a global problem and often WordPress comments are the place when bots try to enter bogus content full of links to their sites. Akismet is an external service for battling spam. It has a database of known emails, IP addresses and username used for sending spam. When a visitor of your website submits a comment, it’s being checked by Akismet and put in a special Spam folder if it matches any criteria. The first thing you should do is to go to the Akismet website and hit the Say Goodbye to Comments Spam button.

wcomm3

Once you have your key, go back to the admin panel of your WordPress site and install the Akismet plugin. If you need assistance in the plugin installation, check out the instructions in our tutorial onhow to install WordPress plugins. Once activated the Akismet plugin will require from you to activate your Akismet account. To do this, press the blue button that will appear above the table of installed plugins.

wcomm4

On the next page, simply enter your Akismet key and press the Use this Key button.

wcomm5

That’s it, your Akismet plugin is set and working on your WordPress site. You will see a confirmation of this and the information about the current status of the Akismet servers.

Next, follow the instructions on the Akismet site to create an account. Once ready, you will be provide with your Akismet Key.

Disable Comments on Specific Pages or Posts

Sometimes, you may wish to disable the comments for certain page or post. For example, yourContact Us page with a simple mail form on it shouldn’t have comments under it. In such cases, you can disable the comments for a particular post or page. To do this, open the post/page itself and scroll down until you reach the Discussion tab. In it, uncheck the Allow comments and Allow trackbacks and pingbacks to display them from showing on this particular post or page.

wcomm6

Install WordPress Themes

In this tutorial we will provide you with detailed instructions on how to install and activate themes in your WordPress site. Check out our WordPress themes gallery for many free designs that you can choose from!

Access install theme functionality in your WP admin

The first thing you need to do when you want to install a new WordPress theme is to login to your site admin page. Once there, go to Appearance -> Themes.

thms1

Here, you will see all the themes you have currently installed in your application. To add another one, simply click on the Install Themes tab.

thms2

On this page there are two ways to add a new theme. You can either use the search field which will return results from the WordPress.org theme directory or you can upload a theme from your local hard drive. In this tutorial we will show you how to add themes in both ways.

Choose and Install a theme from the official WordPress theme directory

The easiest way to install themes to your WordPress site is if they are listed in the official themes directory. This allows you to search for the theme you need directly from your site admin page. Each theme in the official directory has to have Tags that describe its functionality allowing you to easily search for the right theme.

If you know the theme’s name, you can simply search for it.

wptheme2

However, usually that’s not the case. This is why, you can use the Feature Filter. For example, you can search for a Black and White, Two columns theme that has Flexible Width. Simply check those tags and press the Apply Filters button.

wptheme3

You will now see all themes that meet your search. Hover over any of them and you will see two options – to see a demo of the theme or to install it. Once you choose which theme you want to use for your site, press the blue Install button.

wptheme4

Your WordPress application will download and install the theme for you. Simply click the Acticate link on the next page you will be redirected to.

wptheme5

That’s all – you can go to the front page of your site to see its new looks.

it10

Upload a theme you have already downloaded

If you have a theme that’s not listed in the WordPress.org directory, you can simply upload it from theThemes -> Install Themes section in WordPress. To do this click on the Upload link at the top of the page.

thms7

Now, click the Choose File button, select the archive of your theme from your local computer and press the Install Now button.

thms8

In few seconds, WordPress will upload and extract the theme archive for you. All you need to do next is to press the Activate link under the message for successful theme installation.

thms9

That’s it! You can now go to the front end of your site and see the newly activated theme.

Customize WordPress Themes

Depending on the theme you’re using for your WordPress site there are different set of changes you can make to your site from within your admin panel. In this tutorial we will show you how to do some of the changes to your site using the Customization page. For the purpose of this tutorial we will use the Twenty Fourteen theme.

How to Access the WordPress Customization Page

To start customizing your WordPress theme, first go to Appearance -> Themes page..

cust1

On this page, locate the active theme (Twenty Fourteen in our case) and click on the Customizebutton next to its title.

cust2

The next screen will take you to a page that you can use to modify your WordPress theme in real time. On the left you will see a list of the available options and on the right a live preview of your site and how those changes will affect it.

How to Modify your WordPress Title and Tagline

The theme customization page allows you to modify your site’s title and tagline and see how it will look on your actual site immediately. To do this, expand the Site Title & Tagline group of settings and alter the text. As you type you will see the new text showing up in the preview on your right side. Once you’re happy with the result, simply click on the big Save & Publish button.

cust4

Customize your WordPress Front Page

WordPress allows you to choose between two options for your front page – a static page or a list of the latest blog posts with part of their content. This is another setting that you can config from the theme customization page. Expand the Static Front Page tab and you’ll see the available options.

cust5

By default WordPress will show your latest posts on the front page. However, you can change that option to A static page. This will open two more options for you – to select a page to be displayed on your front page and on which page your blog posts should be shown. For both options you’ll be able to choose from the list of all the pages you’ve published. If the list is empty this means that you don’t have a single Page created in your site.

cust6

Additional WordPress Theme Customizations

Depending on the theme you’re using there might be additional options in that page. For example, the Twenty Fourteen theme allows you to modify its site title & background colors, add a background image and more. Once you’re happy with the result, simply click on the Save & Publish button to save the changes.

cust3

 

Customize the Dashboard

The first thing you see when you access your WordPress admin panel is the Dashboard. It is a collection of gadgets that provide you information at a glance so you don’t have to navigate through different pages to get it. For example, you can see the new comments, make a quick draft post, see the latest WordPress news and more.

dash1

To configure what information you want to see on your WordPress Dashboard, click on the Screen Options button in the top-right part of your screen. It will expand a panel that will allow you to check and uncheck the different information blocks you want to see/hide.

dash2

Once you have the gadgets you want to use displayed, you can rearrange them by simply drag-and-dropping them around your screen. Note that since WordPress version 3.8 your admin panel is responsive. This means that depending on the size of your display you will see different number of available columns for your widgets.

dash3

In addition, when you install different plugins, some of them may provide you additional Dashboard gadgets to use. For example, if you have a WooCommerce-based store you can display things like your recent orders, monthly sales graph and more on your dashboard. Those can be shown or hidden from the Screen Options panel too.

dash4

WordPress Banners Tutorial

Nowadays advertisement is essential part of most of the websites on the Internet. In this tutorial we will show you how to add banners to different parts of your WordPress site. Most of the websites that offer banners will provide you with the entire banner code so all you have to do is decide where you want to place the banner and follow the instructions below.

How to add banners to your sidebar

It is common practice to use your sidebar to add banners. There are two ways to do this – if your theme supports widgets in your sidebar, you can add a Text widget with your banner code in it, or you can add the code directly to the sidebar.php file of your theme.

If your theme supports widgets, go to Appearance -> Widgets. Then, drag a Text widget to the appropriate widget area. In our case that would be “Main Sidebar”. For the purpose of this tutorial, we will place this widget right under the search field. Finally, paste the banner code in it, set a title for the widget (that’s optional, leave it empty if you don’t want to have a title above your banner) and hit theSave button.

banner8

This will place the banner you want into the sidebar of your WordPress site.

banner9

If your theme does not support widgets you’ll need to add your banner code directly into the sidebar.php. You can edit this file from the Appearance -> Editor part of your WordPress admin page.

How to add banners into a single post or page

If you want to add a banner into the body of your post or page, simply open the Text mode of the WordPress editor and paste the banner code in it.

banner3

This will add the image between the two sample paragraphs of this post. You can use the WordPress WYSIWYG editor in order to reposition or align this banner in order to make it look with the rest of your post or page.

banner5

How to add banners above or below all posts or pages

To add banners above or below all your posts or pages, you need to add the banner code inside thesingle.php or page.php files of your WordPress themes. Both files have similar content but they handle different parts of your site – your posts (single.php) and your pages (page.php). You can edit those files by logging to your WordPress admin area and going to Appearance -> Editor.

If you want to add the banner above your posts and pages, locate the following code:

<?php while ( have_posts() ) : the_post(); ?>
Right after it add the code of your banner. This will add your banner above the all of your page and post titles. Of course, you can add CSS styling in order to make it look according to your needs.
banner7

How to add banners to your header or footer

Adding banners to your footer or header depends on the theme you’re using. If it has widget area added to its footer or header, you can follow the instructions in the first part of this tutorial for adding banners to the sidebar.

On the other hand, if your theme does not have widget areas added to the footer/header areas, you need to add your banners manually. To do this login to your WordPress admin page and go toAppearance -> Editor. For the purpose of this tutorial, we will add a custom SiteGround banner to your header. Since we will add the banner to the header of the site, select header.php from the list of files available for edit. Note that the code inside this file will be different depending on your theme. You need very basic HTML skills in order to add this banner.

banner1

First, find the opening of the body tag. In the twenty-twelve default WordPress theme it looks like this:

<body <?php body_class(); ?>>
Right after this add the following code:
<div class="headerbanner"><a href="BANNERLINK" target="_blank"><img src="LINKTOIMAGE" width="200" height="50" /></a></div>

You need to replace BANNERLINK and LINKTOIMAGE with the URL where you want the banner to point to and the link to the banner image. Finally, replace the width and height parameters with the actual dimensions of the banner image.

This code will render your banner on top of your site. Note that depending on the theme you’re using, you may need to move the code in order to place it wherever you want.

banner2

Note that we wrapped the banner into a div element. We did this because we want to style this banner further. To do this, select style.css from the right column and when the page refreshes, add the following lines:

.headerbanner { display:block; margin: 10px auto; width: 480px}
This will center the banner and add some top margin making it look much better. Of course, this is just an example - you can use the full power of CSS in order to style the banner the way you want it.
banner4
Adding a banner to the footer is basically the same with one small difference - you need to open thefooter.php file instead of the header.php one. Then, all you need to do is paste the code where you want to display the banner.

Use plugins to show banners on your page

If you want to display more than one banner on a page, track the ads you show, and more advanced functionality, it is advisable to use one of the available WordPress plugins for banner management.

Since it depends on your particular site structure and needs, we suggest that you browse through the banner plugins in the WordPress Plugins Directory in order to find the extension that will best fit your needs. Once you do that, you can install it as any other WordPress plugin following the instructions in our tutorial on How to Install WordPress Plugins.


WordPress Updates

WordPress Manual Update

In WordPress you can easily update your application directly from the admin area. When a new version is available, you will see a notification in the WP admin area.

wp19

Before you proceed with the upgrade, we strongly advise you to make a backup of your WordPress.

When you are ready, click Please update now to proceed with the upgrade.On the next page you can choose whether to upgrade automatically or manually.

wp20

Click Upgrade Automatically

If everything goes smoothly, your WordPress will be successfully upgraded!

WordPress Auto Updates

In WordPress 3.7 a new feature was introduced to the core functionality of the application – the automatic updates. In this tutorial we will do our best to explain you the way those auto updates work, how to configure them and how to completely disable WordPress auto updates in case you want to handle them manually.

Default auto update configuration

By default, from version 3.7 and above, your WordPress site will update itself when a new minor or security update is released. This means, that if you’re on WordPress 3.7.0 and version 3.7.1 is released the application will auto update itself. On the other hand, if WordPress 3.8 is released (a major version) by default you will have to update to it manually.

IMPORTANT If you are using version control system, WordPress will disable its auto updates. Currently, it will check if you’re using Subversion, Git, Mercurial, or Bazaar.

How to enable major release updates

If you want the WordPress auto updates to handle major core updates too, you will have to add a single configuration line. To do this, open the wp-config.php file in the root folder of your WordPress installation and add this line to it:

define('WP_AUTO_UPDATE_CORE', true);

How to enable plugins updates

If you want your plugins to be automatically updated by WordPress when a new version is released, you need to add a line to your wp-config.php file, similar to the one above. This time, however, a filter is used for enabling the plugin auto updates:

add_filter( 'auto_update_plugin', '__return_true' );

How to enable themes updates

If you want WordPress to handle themes updates you need another line added to the wp-config.php file:

add_filter( 'auto_update_theme', '__return_true' );
NOTE This will work only if your theme is downloaded from the official WordPress repository. If you’re using a paid theme for example, or you’ve downloaded your theme from a designer’s website it will not update automatically when new version is released.

How to disable core auto updates but enable plugins and themes auto updates

If you want to stop the autoupdates of the WordPress core, but to enable them for your Plugins and/or Themes, you can add these lines in the wp-config.php file:

Stop the core auto updates:

define( 'WP_AUTO_UPDATE_CORE', false );

Then Enable the plugins/themes:

add_filter( 'auto_update_plugin', '__return_true' );
add_filter( 'auto_update_theme', '__return_true' );

How to completely disable the WordPress auto updates

If you want to disable the WordPress auto updates completely, open the wp-config.php file and add this line to it:

define( 'AUTOMATIC_UPDATER_DISABLED', true );
IMPORTANT If you disable WordPress auto updates completely, that will disable both plugins, themes and core auto updates no mater what configurations you’ve made for themes or plugins.

SiteGround Auto Update Tool

In this tutorial we will show you how to use the WP Auto Update tool developed by us in order to keep your website always safe and up-to-date. The tool provides you with the following features:

How to Access SiteGround WordPress Auto-Update Tool?

First, you need to login to your cPanel account and open the WP Auto Update tool located in the Sitebuilding Software section.

wp_update1

WP Auto Update Overview

On the first screen you will see a brief instructions on how to use WP Auto Update. Under them you will find a list of your WordPress sites. Next to the site URL, you will see its status showing whether WP Auto Update is Enabled or Disabled for this site. The last column in the table is for the available actions you can perform for those sites.

wp_update2

All WordPress applications installed via Softaculous or the SiteGround Getting Started Wizard will be enlisted in the tool by default.

WordPress Core Update Options

If you have a website that doesn’t have WP Auto Update yet and isn’t up-to-date, you will see two options next to it – Enable Autoupdate and Update WordPress Core. The first one will enable the autoupdate feature and schedule update for your site. The second option will instantly perform a one-time update of your WordPress site. We recommend that you enable the autoupdate feature of the tool since it will assure that your site is always up-to-date.

wp_update9

WordPress Plugins Update Options

In addition, there is the Update plugins option available for all sites with WP Auto Update enabled. If you enable this option, all of your plugins will be updated to the latest version alongside with the core application.

wp_update10

Backup Restoration

Note, that if any issues with your website occur due to the automatic update feature, you can always restore your site to its state before the update. WP Auto Update stores a backup of your website each time, it performs an automatic update. If something goes wrong, simply select your site and select the Restore last backup action.

wp_update8

Email Notifications and Disable WP Auto Update Function

Last but not least, if you want to disable the WP Auto Update tool, you can do it anytime. You will receive an email notification 24 hours before the update takes place. If you want, you can stop the update before it begins.

WordPress Security

WordPress Security Tutorial

WordPress is the most popular blogging and CMS system on the Internet which makes it a favorite target for hackers. Having a WordPress site means that you have to take some extra efforts in order to protect your and your visitors data. Here is a summary of the best practices for securing a WordPress, that will help you do that. It is important to mention that these measures don’t guarantee a 100% protection against hacking attempts, mostly because a 100% secure website doesn’t exist, but they will protect you against the majority of attacks.

Keep your WordPress site and plugins up-to-date

It is really important to keep your core WordPress files and all of your plugins updated to their latest versions. Most of the new WordPress and plugin versions contain security patches. Even if those vulnerabilities cannot be easily exploited most of the times, it is important to have them fixed.

For more information on that matter, check out our tutorials on how to update WordPress and how to use WordPress auto updates.

Protect your WordPress Admin Area

It is important to restrict the access to your WordPress admin area only to people that actually need access to it. If your site does not support registration or front-end content creation, your visitors should not be able to access your /wp-admin/ folder or the wp-login.php file. The best you can do is to get our home IP address (you can use a site like whatismyip.com for that) and add these lines to the .htaccess file in your WordPress admin folder replacing xx.xxx.xxx.xxx with your IP address.

<Files wp-login.php>
order deny,allow
Deny from all
Allow from xx.xxx.xxx.xxx
</Files>

In case you want to allow access to multiple computers (like your office, home PC, laptop, etc.), simply add another Allow from xx.xxx.xxx.xxx statement on a new line.

If you want to be able to access your admin area from any IP address (for example, if you often rely on free Wi-Fi networks) restricting your admin area to a single IP address or to few IPs can be inconvenient. In such cases we recommend that you limit the number of incorrect login attempt to your site. This way you will protect your WordPress site from brute-force attacks and people trying to guess your password. For such purposes, you can use a nice little plugin called Limit login attempts.

Don’t use the “admin” username

Most of the attackers will assume that your admin username is “admin”. You can easily block a lot of brute-force and other attacks simply by naming your admin username differently. If you’re installing a new WordPress site, you will be asked for username during the WordPress installation process. If you already have a WordPress site, you can follow the instructions in our tutorial on how to change your WordPress username.

Use strong passwords

You will be surprised to know that there are thousands of people that use phrases like “password” or “123456” for their admin login details. Needles to say, such passwords can be easily guessed and they are on the top of the list of any dictionary attack. A good tip is to use an entire sentence that makes sense to you and you can remember easily. Such passwords are much, much better than single phrase ones.

Consider two-factor authentication

Enabling two-factor authentication for your WordPress website will significantly improve the security of your website. One of the easiest ways to do this is to use Clef to authenticate using your mobile phone. For all SiteGround users, Clef authors have created an ad-free version of their plugin. Check out our Clef tutorial for more information on that matter.

Make sure you’re site is on a secured WordPress hosting

Your WordPress site is as secured as your hosting account. If someone can exploit a vulnerability in an old PHP version for example or other service on your hosting platform it won’t matter that you have the latest WordPress version. This is why it is important to be hosted with a company that has security as a priority. Some of the features that you should look for are:

  • Support for the latest PHP and MySQL versions
  • Account isolation
  • Web Application Firewall
  • Intrusion detecting system

Ensure your computer is free of viruses and malware

If your computer is infected with virus or a malware software, a potential attacker can gain access yo your login details and make a valid login to your site bypassing all the measures you’ve taken before. This is why it is very important do have an up-to-date antivirus program and keep the overall security of all computers you use to access your WordPress site on a high level.

WordPress Spam Protection

In this tutorial we will show you how to protect your WordPress blog from spam.

There are several solutions which can be completed:

1. Make sure that your WordPress script is updated to the latest stable version. Detailed instructions regarding the WordPress update can be found on the corresponding tutorial page.

2. Install a captcha plugin. A good choice is the WordPress ReCaptcha plugin. Comprehensive instruction on how to install a WordPress plugin can be found here. Once activated, the plugin will prompt for the public and the private API keys. The visualized link will take you to the corresponding Google web site where you can get the API keys for free. Paste them in the corresponding fields and activate your ReCaptcha plugin for comments and users registrations.

3. WordPress comes with a preinstalled antispam solution – Akismet.

In order to use Akismet, you should have a WordPress API key.To receive a WordPress API key, you should register at the official WordPress website. The key will be included in your welcome mail.

If you already have a registration at WordPress.org, you can see your API key by visiting the WP dashboard.

To enable Akismet for your blog, follow the steps below:

STEP 1 Go to your WordPress admin area > Plugins > Installed.

STEP 2 Click Activate.

wps

The Akismet plugin will be activated.

wps1

STEP 3 Click “enter your WordPress.com API key” (you can also click Akismet Configuration in the Plugins section)

wps2

STEP 4 Enter your WordPress API key.

STEP 5 Click Update options>>.

STEP 6 If you have entered a correct API key, it will be verified.

wps3

From now on your blog will be protected from spam by Akismet. You will be able to check the comments in your blog for spam, as well as manually mark comments as spam from the blog admin area > Comments.wps4

You can also display on your blog’s front page how many spam posts have been stopped by Akismet. To show this information, you should add the Akismet widget to your sidebar. More information how to do this can be found in our article on how to add a widget to the WordPress sidebar.

4. Additionally, you can prevent the comments posted by visitors that come from suspicious and malicious IPs. This can be done using the WordPress Project Honey Pot plugin.

Change WordPress Username

If you have an existing WordPress site and you want to change your username(to something different than “admin” for security reasons, for example), you can do this quite easily.

First, go to your cPanel and click on the phpMyAdmin icon in the Database section.

nu1

Next, locate your WordPress database from the list on the left.

nu2

If you’re not sure which one it is, you can check the wp-config.php file in the root folder of your WordPress installation and in particular the line below:

define('DB_NAME', 'user_wp448');

Once you select your WordPress database, you will see a lit of its tables. Choose the _users table from the left menu.

nu3

You will see a list of all the registered users in your site. Locate the admin username and click on theEdit button on that line.

nu4

Now, you will see all the fields for this username. Locate the user_login field and replace its value from admin to your new preferred WordPress login name and hit the Go button at the bottom of the page.

nu5

That’s it, you can now login with your newly selected WordPress username!

Remove Spam From Comments

By default all links posted in the comments under your articles are turned by WordpPress into links.

Unfortunately, this features encourages spammers to post many unwanted comments in your blog.

To disable turning URLs from comments into actual links, go to your admin area and then navigate to Appearance -> Editor.

Select the functions.php file from the right column and add the following line just above the closing php tag ( ?> ):

remove_filter('comment_text', 'make_clickable', 9);
THAT’S IT! URLs pasted in your comments will not be turned into actual links anymore.

WordPress Administration

WP-Cli Tutorial

WP-Cli is a command line interface which allows the users to manage their WordPress web sites from the command prompt. Upgrades can be performed, backups can be generated, new posts can be published and most of the regular admin actions can be performed with a set of commands.

In this tutorial we will explain how to use the WP command line interface in order to complete regular administrative tasks like upgrades, database backup creation, plugins and themes installations and removals, publishing and deleting posts, changing site’s URL settings and getting help on chosen commands. Note that WP-Cli requires an SSH access.

List the Available WP-Cli Commands

First, we will start with the instructions on how to list the available commands and get detailed help for each one of them.

To list all the commands write wp help or just wp.

The following list will be shown:

Available commands:wp core [download|config|install|install_network|version|update|update_db]
wp db [create|drop|optimize|repair|connect|cli|query|export|import]
wp eval-file
wp eval
wp export [validate_arguments]
wp generate [posts|users]
wp home
wp option [add|update|delete|get]
wp plugin [activate|deactivate|toggle|path|update|uninstall|delete|status|install]
wp post-meta [get|delete|add|update]
wp post [create|update|delete]
wp theme [activate|path|delete|status|install|update]
wp transient [get|set|delete|type]
wp user-meta [get|delete|add|update]
wp user [list|delete|create|update]

See ‘wp help ‘ for more information on a specific command.

Global parameters:
--user=<id|login>set the current user
--url=set the current URL
--path=set the current path to the WP install
--require=load a certain file before running the command
--versionprint WP-Cli version

If you want to get detailed documentation, for example, for the wp db export command, enter the code listed below:

wp help db export

The result will be as follows:

WP-DB-EXPORT(1) WP-Cli WP-DB-EXPORT(1)
NAME
wp-db-export - Export the WordPress database using mysqldump.
SYNOPSIS
wp db export [file]
OPTIONS
file: The name of the export file. If omitted, it will be ´{dbname}.sql´

Now we will proceed with the regular management tasks.

Update WordPress via WP-Cli

First, we will show how to update the core files of your web site. We will check the current version which we have:

wp core version
3.4.2

Obviously it is outdated. In order to use the latest scripts features and have all the vulnerabilities in the older versions patched we should always use the latest stable releases for our web site applications. Using WP-Cli we will complete the upgrade with a single command:

wp core update
Downloading update from https://wordpress.org/wordpress-3.5.1-new-bundled.zip...
Unpacking the update...
Success: WordPress updated successfully.

Update WordPress Plugins using WP-Cli

The update of the core files and the database are not always enough. If we have integrated external plugins and/or themes we should take care of their upgrade. We need to check the status of the installed extensions:

wp plugin status

Installed plugins:
UI akismet
I hello
UA jetpack
A limit-login-attempts
A SGCachePress

Legend: I = Inactive, A = Active, M = Must Use, U = Update Available

We have 5 plugins integrated in our sample installation. There are upgrades for two of them. We will complete the upgrades through the following commands:

wp plugin update jetpack

Downloading update from https://downloads.wordpress.org/plugin/jetpack.2.3.zip...
Unpacking the update...
Installing the latest version...
Removing the old version of the plugin...
Plugin updated successfully.
wp plugin update akismet

Downloading update from https://downloads.wordpress.org/plugin/akismet.2.5.8.zip...
Unpacking the update...
Installing the latest version...
Removing the old version of the plugin...
Plugin updated successfully.

Install and Activate WordPress Plugins & Themes via WP-Cli

To install and activate a new plugin run the commands listed below:

  • wp plugin install Plugin_Name
  • wp plugin activate Plugin_Name

You should replace the “Plugin_Name” string with the exact plugin name.

If you do not need a plugin you can remove it through the following action:

wp plugin uninstall Plugin_Name

Next, we will check the themes:

wp theme status
Installed themes:
UA twentyeleven
UI twentyten
I twentytwelve

Legend: I = Inactive, A = Active, U = Update Available

To update all the themes the following command should be executed:

wp theme update --all 

Enabling Maintenance mode...
Downloading update from https://wordpress.org/themes/download/twentyeleven.1.5.zip...
Unpacking the update...
Installing the latest version...
Removing the old version of the theme...
Theme updated successfully.
Downloading update from https://wordpress.org/themes/download/twentyten.1.5.zip...
Unpacking the update...
Installing the latest version...
Removing the old version of the theme...
Theme updated successfully.
Disabling Maintenance mode...
Success: Updated 2/2 themes.

The themes can be installed, activated and uninstalled in a similar way to the plugins:

  • wp theme install Theme_Name
  • wp theme activate Theme_Name
  • wp theme delete Theme_Name

The “Theme_Name” string should be replaced with the actual theme name.

The activation will make the chosen theme the default one for your WordPress installation.

Other Tasks you Can do With WP-Cli

We can even write posts directly from the command line. The creation of a sample post on a new page is illustrated below:

wp post create --post_type=page --post_status=publish --post_title='My test post' --post_content='This is a test post'Success: Created post 4.

If we do not need a certain post we can easily delete it:

wp post delete 3 --forceSuccess: Deleted post 3.

Once we have our script upgraded and the content set we can generate a database backup:

wp db exportSuccess: Exported to user_wp790.sql

If the web master decides to change the primary domain for the WordPress web site he/she can easily update the corresponding URL options:

wp option update home https://newdomain.com
wp option update siteurl https://newdomain.com

More details on WP cli can be found through the help command and the project’s home page.

Reset WordPress Password

In this tutorial we will show you how to reset your WordPress password. If you’re a SiteGround customer that would be a much easier task. If you’re not hosted with us, scroll down to the second part of the tutorial.

Instructions for SiteGround customers

If hosted with SiteGround, you can use the WordPress Admin Tools app in your cPanel to quickly execute different WordPress management tasks including changing your users passwords.

To begin, you need first to login to your cPanel and navigate to the WordPress Admin Tools link under the WordPress Tools tab.

toolkit

Now, locate the site you want to gain access to and click on the Reset Password link next to it.

wrp2

The line will expand, allowing you to select one of your WordPress users for this site and reset its password.

wrp3

Finally, click on the Change Password button. That’s it, you can now login with your new password.

Instructions for non-SiteGround WordPress users

If you’re not a SiteGround customer, the easiest way to reset your WordPress password is via the phpMyAdmin tool in your hosting command panel.

First, open the wp-config.php file in your WordPress root directory and locate the following line:

define('DB_NAME', 'user_wrdp1');

This line specifies the database that your WordPress site is using (in our example wrdp1). Once you have your database name, open the phpMyAdmin tool and click on the same database from the list on the left.

wrp4

Next, click on the SQL link in the top menu.

wrp5

Here, you need to enter the password reset query replacing NEWPASSWORD with the actual new password you want to use:

UPDATE `wp_users` SET `user_pass` = MD5('NEWPASSWORD') WHERE `wp_users`.`user_login` = "admin_username";

Once you do that click on the Go button in the bottom right part of the screen to execute the query.

wrp6

You can now login with your new password. If you want to change your WordPress admin username too, you can follow the instructions in our tutorial on how to change your WordPress username.

WordPress Backup

Having backups of your site is essential. Every webmaster should have few backups of his/hers website in case something goes wrong. In this tutorial we will cover the easiest and most useful ways to backup your WordPress website.

Backup WordPress Manually

WordPress is a web application based on PHP and MySQL. As such you need to backup all its files and its database to have a full copy of your site. The easiest way to copy your files is via FTP. To do this follow the instructions in our tutorial on how to use FTP. Make sure that you save all the files and folders in the directory WordPress is installed in (public_html if it’s the main application for your site).

The WordPress database can be backed up as any other database. Simply follow the instructions in our tutorial on how to backup MySQL databases. In case you have multiple MySQL databases and you wonder which one your site is using, open the wp-config.php file in the WordPress root folder and you’ll see the database name saved next to the DB_NAME option.

Use Softaculous to Backup WordPress

Although the main purpose of Softaculous is to install new applications with a single click, it can be used to create a full backup of your WordPress site.

bw1

Now, you will see a list of the WordPress applications installed in your account via Softaculous. In case you don’t see your site listed here, probably it was not installed via Softaculous. This means that you will have to add it to the system by using the Import page on the same screen. To begin the backup process, click on the yellow folder icon next to the site.

bw2

On this page, you can select whether to backup only the WordPress files, only its database or both. In addition, you will receive some useful info about the folder and database that will be backed up. If you wish, you can add a note to this backup. Then, simply click on the Backup Installation button at the bottom of the page.

bw3

In few moments, your backup will be ready (time can vary depending on your site size) and you will receive a confirmation message for a successful backup creation. Follow the link to the Backups page to proceed.

bw4

Here you will see all the backups you’ve created. If you want to store your backup locally, simply press the blue arrow icon to download it to your computer.

bw5

That’s it, you now have a full backup of your WordPress site!

Change Admin Color Scheme

In WordPress 3.8 six different color schemes were introduced to your admin panel. Follow the instructions below to change from one color scheme to another!

To begin, login to your WordPress admin panel and go to Users -> All Users.

csch1

On this page, locate your user or the one you want to change the color scheme for and click on theEdit link that will appear when you hover on the username.

csch2

On the top of that page you will see a list of six different color schemes. Simply click on the radio button next to each one of them and your admin backend will refresh in the new set of colours!csch3

That’s it, you don’t even need to hit the Save button at the bottom of the page because your settings automatically update when you select a different scheme!

WordPress Optimization

In this tutorial we will give you some tips on how to improve the speed of your WordPress website. Having a fast site is essential if you want to provide your visitors with great user experience and rank well in the search engines like Google and Bing which take the loading speed of your pages into consideration.

Enable Dynamic Caching

Adding properly configured Dynamic caching to your WordPress site will have great effect on its speed. There are many services like Varnish and APC that can be used but all of them require a lot of server configuration and tweaking of your application to work correctly. This is why, we at SiteGround have created a tool called the SuperCacher. With it, all you need to do is install a small plugin and enable the Dynamic caching with a single click. For more information on how to use it, please check out our SuperCacher Tutorial.

Enable gZIP compression

To decrease the size of data that’s being transferred between your server and your visitors, you can enable the gZIP compression for your images, CSS and JavaScript files. By doing this, the web server will compress (like creating a ZIP file for example) this content before it’s transferred over the Internet to your browser. On the other side, your browser decompresses the content before rendering it. This significantly lowers the size of information that’s being transferred lowering the loading times of your pages.

The easiest way to enable the gZIP compression for your images, CSS and JS files is to add these lines to your .htaccess file in the root WordPress folder:

## ENABLE GZIP COMPRESSION ##
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
## ENABLE GZIP COMPRESSION ##

Use a CDN

Content delivery networks (CDN) are server networks that clone your site on all of their location nodes. This means that when your visitors request your site, it will be served by the closest server location, rather than the main datacenter of your hosting provider. For more information on that matter, check out our CloudFlare CDN Tutorial.

Optimize your Images

Images are essential part of every website. It is important to have them optimized. There are few things regarding our images that you should mind when making your WordPress site:

  • Use images with the proper size. Do not upload big images and then scale them with HTML. Make sure that your photos and other images are not bigger than the size you’re actually displaying them in.
  • Smush your images. Smushing them will remove all the additional data from your photos – creation date, camera used for the photo, gps coordinates, etc. There is a nice little plugin that does that for you called WP Smush.it.
  • If possible, use Sprites for your themes. Using sprites is a CSS technique that uses a single image to show multiple design elements on your pages. This way instead of loading dozens of small images (making http requests each time), your site will open a single one. Sprites, however, must be considered when the theme is designed. So always look for themes that utilise sprites.

Minify your JavaScript and CSS files

Minifying your CSS and JavaScript files means that all the unnecessary data from them like double spaces, empty new lines, comments, etc. will be removed from the files lowering their size. There are many online tools that you can use for free to minify your files. In addition, if you’re using the W3 Total Cache plugin, it has an option to automatically minify your theme’s CSS and JS files.

Leverage browser caching

Leveraging the browser caching means that you can specify for how long your visitors’ browsers should cache your images, CSS, JS and flash files. However, if any of those resources is set, your server will notify the visitors browser and the cached content will be replaced with the new one. You can add the lines below to your .htaccess file in order to enable this technique.

## LEVERAGE BROWSER CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType application/x-javascript "access 1 month"
ExpiresByType application/javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 2 days"
</IfModule>
## LEVERAGE BROWSER CACHING ##

Optimize your WordPress Database

It’s a good practice to optimize your WordPress database from time to time. You can think of this as running a Disk Defragmenter on your local hard disk. For more information on that matter, check out our article on How to Optimize a MySQL Database.

Old WordPress Admin Look

Amongst many great features, WordPress 3.8 introduced a new, shiny look for the admin area. Although trendy, its dark colours may look strange to webmasters that are used to the old looks.

Thankfully, there is an easy way to make your WordPress admin panel look like it used to. All you need to do is to install a small plugin named wp-admin classic. Simply install and activate it, following the instructions in our tutorial on how to install WordPress plugins. Right after that, your admin panel will look like you’re used to!

oldadmin

WordPress Plugins

Install WordPress Plugins

Plugins are tools which provide additional functionality to your application. To install a plugin you generally just need to put the plugin file into your ‘wp-content/plugins’ directory. Once a plugin is installed, you may activate it or deactivate it from the Plugins menu in your WP administration.

plg1

Generally the Plugin installation is a straight-forward process. In most cases it is enough to upload the plugin under the ‘wp-content/plugins’ directory for the WordPress installation and activate it from the administrator backend.

plg2

In WordPress 2.7 and above you can install plugins directly from the admin area. Download the plugin to your computer, then log in to your WP admin area and go to Plugins > Add New. Browse to the plugin archive and select it. Then click Install Now and the plugin will be installed shortly.

plg3

The removal is also straight-forward in most cases. Simply remove the directory for the plugin you would like to uninstall and it will be automatically deactivated.

Still always bear in mind that not all plugins are easy to install, so always refer to their documentation and installation instructions first.

Clef Tutorial

Enabling a two-factor authentication for your WordPress website greatly improves the security of your website. In this tutorial we will show you how to install and use Clef – probably the easiest way to implement two-factor authentication in WordPress.

How to Install Clef

If you install a new WordPress application using our 1-click installer Softaculous, you can simply place a check on the Clef Secure Passwordless login option on your installation screen.

clef20

If you place a mark on this checkbox, Clef will be automatically installed. Read on, to see how to enable it for your WordPress site.

If you have a WordPress application installed, or you prefer to make a manual WordPress installation, Clef can be installed as every other plugin. For detailed information on how to do that, check our tutorial on How to Install WordPress Plugins. You can download the Ad-free version of the plugin from the Resources page in your User Area.

clef21

How to Enable Clef

To enable Clef and start using it, first you need to login to your WordPress backend and click on theClef link from the left menu.

clef2

This will take you to the initial Clef configuration screen. Press the big Get Started button to proceed.

clef3

Clef will provide you with links to install the required application on your mobile phone. To do this, press the get the clef app button. If you already have the application installed on your smartphone, click on the I already have the app link on the top of the page.clef4

In order to use the Clef application for login, you need to provide your email and a choose your 4 digit pin code. This way, you make sure that no one except you can use your phone to access your sites.clef19

Once you have the app installed on your phone, you will be asked to synchronize your app with your WordPress site. To do this, start the Clef app and hold your mobile phone so it can record the moving “waves” on the screen. In few seconds (while the camera focuses), your app will be synchronized with this website.

clef6

That’s it, all you need to do now is press the complete setup button.

How to Login and Logout with Clef

When Clef is installed and synchronised with your mobile app, your WordPress login screen should look like this:

clef17

Simply start the Clef mobile app and hold your phone in front of the moving lines. Once the camera focuses, you will be logged into your WordPress site. It’s that simple!

TIP If you want to login to WordPress on your mobile phone, the login form will directly load your Clef application. All you need to do then is to simply type in your Clef PIN code and you’ll be logged into your WordPress admin panel.

To logout from WordPress you need to click the big logout now button of the Clef application on your mobile phone. Unless you do that, you will remain logged in the browser until the Clef app timer runs out.

clef13
TIP By default, Clef will keep you logged in for one hour or until you logout manually. However, you can modify that period through your mobile application.

How to Disable Regular Passwords

By default, after activation, Clef doesn’t disable the standard WordPress authentication method. This means that if someone knows your password, they will still be able to access your account. If you want to be sure that this won’t happen, you need to force the usage of Clef for the site users. There are few options to do that, all listed below.

The first option on your Clef settings page allows you to force Clef login for all users that have installed and synchronised their Clef mobile apps with your site. To do this, simply place a check on the Disable passwords for Clef users checkbox.

clef10

Clef provides you with another option to force Clef logins. Using the Disable passwords for all users with privileges greater than or equal to option, you can leave regular subscribers with the ability to login with normal username and password but force editors and users with more privileges for example to use Clef for extra security.

clef12

If you want to completely disable the regular login for your WordPress website and hide that option from the login screen, you can do this by placing a check on the Disable passwords for all users and hide the password login form option.

clef11

How to Disable Clef

If you want, you can always disable Clef and go back to the standard logging mechanism provided by WordPress. To do this, click on the Disconnect Clef account link in the left menu of your WordPress admin area. Next, press the Disconnect your Clef account button.

clef16

That’s it, you can now login to WordPress the standard way.

Lost your Phone?

If you lose your phone, or it gets stolen, Clef provides you with an easy way to get back the access to your site and disable it for your missing phone. To do this, simply follow the instructions in the officialLost your Phone? page on the Clef website.

clef15

 

WordPress Shopping Cart

There are various contributions you can use in order to setup an online store for your existing WordPress website. One of the widely preferred plugin is Simple Paypal Shopping Cart, to which this tutorial is dedicated.

How to install Simple PayPal Shopping Cart?

There are two standard options for installing a WordPress Plugin. You can either use the Search or Upload functionality.

For this tutorial we will demonstrate how to perform the installation by searching for the desired plugin.

First log into the administrator area of your WordPress installation. Then go to Plugins -> Add New.

wpsc000

In the search field choose Term from the drop-down menu, then enter “Simple Paypal Shopping Cart” in the text box and click the “Search Plugins” button.

wpsc01

The “WordPress Simple Paypal Shopping Cart” should appear as first result. Click the Install link for it.

wpsc02

In the new window that will pop-up click the “Install Now” button.

wpsc03

The plugin will be automatically downloaded and installed for your WordPress. Once the installation is completed, click the Activate Plugin link.

wpsc04

How to setup Simple PayPal Shopping Cart with WordPress

The WordPress Shopping Cart is now installed and you can alter the settings for it and adjust the options according to your needs. Go to Settings -> WP Shopping Cart and modify the various options.

wpsc05

Bear in mind that it is imperative to enter your Paypal email address in order to be able to receive funds for products you will create on your website.

At the top of the Settings page for the WordPress Shopping Cart you will see instructions how to create Add to cart buttons on your pages and how to display the shopping cart and the products in it.

In order to create a new post with a product for your WordPress Shopping Cart go to Posts -> Add New.

wpsc06

Here is an example data you can enter in a new page in order to create a sample product.

wpsc07

Enter the desired text and images if you like, and the WordPress shopping cart product code. Note that you need to change the “Product” and the number in the wp_cart tag to reflect the desired product name and price.

For the shopping cart itself we will use the widget for the plugin. Go to Appearance -> Widgets.

wpsc08

Drag and drop the WP Paypal Shopping Cart widget to the Sidebar.

wpsc09

You can adjust its position. When you are happy with the placement between the other available widgets click Save.

wpsc10

Now you can visit your website main page and check out how it looks. The new post text you have entered will be displayed along with the “Add to Cart” button.

wpsc11

When you click Add to Cart the shopping cart will be updated and you will see the product and its price.

wpsc12

You can adjust the desired quantity or remove the product via the red circle with a cross button at any time.

WordPress Images

WordPress makes it really easy to add media to your posts. To add media to a new post, go to your blog’s admin area->Posts -> Add New.

In the WYSIWYG editor menu you can click any of the following buttons to add media to your post – “Add an image”, “Add Video”, “Add Audio” and “Add Media”. Check our Knowledge base article to learn more and see a video about how to add media to your WP posts.

If, however, you need some extra gallery functionality, you may have to use a gallery plugin.

Gallery Plugin in WordPress

In this tutorial we will show you how to install and use the NextGEN gallery plugin. You can download it from this link. More information on how to install plugins in WordPress can be found here –WordPress plugins installation.

Once the NextGEN plugin is installed, you can see its admin section included in WP:

wp16

This plugin has very intuitive interface and you will get the hang of it in no time.To add the NextGEN Gallery to your WordPress frontpage, you should add its widget to the WP sidebar. This can be done from the WP admin area > Appearance > Widgets. Click the Add button next to NextGEN Widget and then click the Save Changes button located on the right.

wp17

This will publish the widget and your gallery will be visible from your frontpage.

wp18

FooBox Media Lightbox

If you wish to add a lightbox plugin to your WordPress, we recommend FooBox Media Lightbox. There are few key features that make it stand-out from the rest of the lightbboxes out there. First of all, FooBox is fully responsive meaning it will work flawlessly on your mobile devices too. In addition, FooBox has built-in social sharing too. In this tutorial we will try to explain in details how to install and use every feature of this plugin.

How to Install FooBox Lightbox?

FooBox is a paid plugin which means you cannot get it directly from your WordPress admin interface but you need to download it first. Once you do that, go to Plugins -> Add New.

fb1

On this page click on the Upload link.

fb2

Next, choose the FooBox archive file you’ve downloaded from the plugin official site and press theInstall Now button.

fb3

Once the page reloads, click on the Activate Plugin.

fb4

Finally, you need to activate the FooBox plugin. To do this go to Settings -> Foobox. On that page, paste your license key into the FooBox License Key field and click Validate. This will check if your license key is valid and if so you will see a green marker indicating that.

fb5

 

How to Configure the FooBox Look?

One of the best things about FooBox is that it’s very customizable. You can configure practically every part of the lightbox and its behavior on your site.fb7

Those settings are located in the Look & Feel tab. Here is a list of the options you can tinker with:

  • Theme – choose one of the two available themes – Rounded (rounded corners) or Metro (square corners).
  • Colour Scheme – choose one of the five available color schemes so that your lightbox matches the design of your site.
  • Icon Set – select the icons for your images navigation.
  • Loader Icon – select the icon that will be shown while the image is loading.
  • Show FooBox Captions – select whether to show captions inside the FooBox.
  • Force Caption To Bottom – fix all captions at the bottom of the screen.
  • Show Captions On Hover – only show captions when you hover over the image.
  • Override Caption Title – select where the FooBox title will be pulled from.
  • Override Caption Description – select where the FooBox description will be pulled from.
  • Prettify Ugly Captions – try to make captions for images with no titles look prettier. For example image-showing-something-021 would result in “Image Showing Something”.

Depending on the configurations you’ve selected, your FooBox can look like this:

fb8

Or like this:

fb9

There are endless combinations that you can try out. The best configuration depends on your design and the way you want to present your images to your visitors.

 

How to Configure FooBox Social Sharing?

To enable the built-in social sharing in FooBox, go to the Social Icons tab in the plugin’s configuration page and place a check next to the Social Icons Enabled title.

Once you do that, FooBox will display a set of sharing icons when your visitors open your lightbox content. The settings bellow manage the behavior of this social bar:

  • Share Item Directly – select whether you want to share the picture your visitor has clicked on or the page it was added.
  • Show Icons On Hover – only display the social icons bar when your visitors hover over the image.
  • Title When Sharing – choose which part of the post/page to be used for title or set a custom one.
  • Vertical Position – choose how to align your social icons vertically
  • Horizontal Position – choose how to align your social icons horizontally
  • Stack Icons – if you’ve selected to display your social icons in the Top-Left or Top-Right positions, you can place a check in this field to stack them one above the other.
  • Networks – in this section you will find a list of social networks that you can share your content to. Place a checkmarks next to the ones you want to use. The settings after that are specific for the selected networks.

 

FooBox on Mobile Devices

As we mentioned in the initial paragraph of this tutorial FooBox is fully-responsive. This means that your lightboxes will work and look great on all devices even if your WordPres theme is not responsive. You don’t need to configure anything – it just works right out of the box.

fb10

WordPress Classifieds Plugins

In this section of the tutorial we will briefly describe several WordPress Classifieds Plugins.

Popular WordPress Classifieds Plugins

  • WP Classified – The general use of this plugin is adding classifieds page to your blog. Thus enabling site visitors to create their own classified ads and also giving the option to navigate through the list of classified ad caretegories. The functionality is basic and very easy to use. Note that this plugin will greatly help you adding classifieds section as a feature for your website. It is not designed to make classified ads the primary resource of your WordPress based website. You can check WP Classified website for more information.
  • Another WordPress Classifieds Plugin (AWPCP) – This plugin is very similar to WP Classified described above. However, this plugin includes much more options, it is highly configurable and customizable according to the needs of your website. The full list of features can be found on the plugin page at the official WordPress website plugins section.
  • Your Classified Ads – The Your Classified Ads plugin is still in Alpha at the time of the release of this tutorial article. Still, it is one of the best classified ads plugins for WordPress. The plugin is designed for the new WordPress version 3 and uses the new Custom Post Types feature available in WordPress 3. Also it includes widgets such as ads search form, terms cloud (eg. ads tag cloud), single ad details (post author, other ads by this author etc). You can check Your Classified Ads website for more information.

WordPress Classifieds Installation and Usage

All WordPress plugins are installed similarly. The classifieds plugins mentioned above do not differ. Detailed instructions how to have a plugin installed for WordPress you can find here. For more information how to have the specific plugins installed and how to use them check the corresponding plugin tutorial page:

BuddyPress as Community Site

BuddyPress Features

The BuddyPress plugin provides a large variety of features for your WordPress website. It is free, open source and completely customizable. The main function of BuddyPress is to greatly enhance the capability of WordPress in building a community website. It will give your website members the ability to create groups and invite their friends, check activity feeds, create discussion boards and much more. Full list of features can be found on BuddyPress official website.

If you want to start your own community website, please take a look at our special BuddyPress hosting pack.

BuddyPress Installation

The Buddy Press plugin initial installation does not differ in any way from a standard WordPress plugin installation. Once you have installed it and enabled for your WordPress website there are a few further changes that should be made. The following notification will be displayed under your WordPress administrator area.

buddypress01(1)

BuddyPress Initial Setup

It is advisable to choose a BuddyPress compatible theme and use it for your website. This will ensure you will not encounter theme related issues at some point. Clicking the “install some other compatible themes” link will load a list of the currently available BuddyPress compatible themes.

buddypress02(1)

Once you are done adjusting the template it is time to setup the specific settings for your BuddyPress installation. You will see a new tab for BuddyPress just below the Dashboard under your WordPress administrator area.

buddypress03(1)

BuddyPress General Settings

Click BuddyPress and you will see several sub-categories.

The General Settings page will allow you to alter the basics for your installation. You will find that all options are enabled by default and if you specifically do not want to use certain functionality you should disable it. For example you might choose to hide the admin bar for logged out users. This means unless a user is logged in to WordPress he will not see the top bar.

buddypress04(1)

Note that by default, all BuddyPress components are enabled. You can selectively disable any or all of the components. In this case the BuddyPress installation will still function, however the features of the disabled components will no longer be accessible. Those can be altered under the Component Setup page for BuddyPress.

Via Forum Setup you can setup the forum for your website via a single click. Forums in BuddyPress use bbPress in order to function. You have two options at this point. If you do not have an existing bbPress installation you can perform a new one. Alternatively if you already have a bbPress forum installed for your WordPress website you can use it. All you need to do is click the corresponding button.

buddypress06(1)

The installation is fully automated. The only action required on your side is entering the path to the existing bbPress installation in case you choose the second option.

Finally the Profile Setup field provides the needed functionality to create custom profile fields for your website community members. Those will greatly vary depending on the actual theme of your social network and can be made either required or optional. Also all fields in the first group will be present on the signup page. Fields that are present in other groups you create will be available for the community members to alter once they have created an account.

buddypress07(1)

Recent Comments

Recent Comments Features:

  • Highly configurable via WordPress admin interface;
  • Support for WordPress 1.5 or higher;
  • Adjustable layout by macros;
  • Handles trackbacks and comments in separate lists, in one combined list;
  • Widget support;
  • Caches the output;
  • Order comments by date, or by posting;
  • Support for gravatars;
  • Option to exclude comments to posts in certain categories;
  • Doesn’t show pingbacks originating from own blog;
  • There is a special version for lyceum multiblog installations, which could be found here .

How to install Recent Comments

STEP 1 First of all you will need to download the get-recent-comments-1.5.1.zip file from here.

STEP 2 As soon as you have the file you should unzip it in your local computer.

Then, you should upload the get-recent-comments.php file under your:

/public_html/path_to_your_blog/wp-content/plugins directory.

If you are not sure how to do this, we kindly recommend you to refer to our FTP tutorial where you will find step by step instructions how to do this.

STEP 3 When the plugin is uploaded under your plugins directory you should access the administrative area of your WordPress at: https://yourdomainname.com/wp-admin.php

Being there you should get to the Plugins section from the top menu.

image15

Click on the Activate button on the left. This will activate the plugin that you have already uploaded.

STEP 4 Drag the widgets “Get Recent Comments” and “Get Recent Trackbacks” into the sidebar.

If your theme does not yet support widgets, insert to following code into the sidebar template:

<?php if (function_exists('get_recent_comments')) { ?>
<li>
<h2>
<?php _e('Recent Comments:'); ?>
</h2>
<ul>
<?php get_recent_comments(); ?>
</ul>
</li>
<?php } ?>
<?php if (function_exists('get_recent_trackbacks')) { ?>
<li>
<h2>
<?php _e('Recent Trackbacks:'); ?>
</h2>
<ul>
<?php get_recent_trackbacks(); ?>
</ul>
</li>
<?php } ?>

We strongly recommend you to revise the Instructions section under the Recent Comments plugin menu.

WP Classified plugin

his part of the tutorial describes how to use the WP Classified plugin for your WordPress installation. You can find more about WordPress Classifieds plugins here.

First you will need to have the pugin installed. Download it from the official WordPress plugins directory -> WP Classified. Then have it installed for your WordPress application You can do so via the WordPress admin area -> Plugins -> Add New -> Upload.

wpc01

Browse for the downloaded plugin archive and then click the Install Now button.

wpc02

Once the plugin is installed it can be activated via the Plugins section under the WordPress admin area.

After you have activated the plugin a new wpClassified section will be available on the left side panel under the WordPress admin area.

wpc03

When you open the wpClassified settings for the first time you will be asked to install the plugin. By clicking the provided link you will add the needed tables in your WordPress database.

wpc04

You can now proceed with adjusting the configuration for your newly installed wpClassified. Once the settings are adjusted according to your needs you can start creating new categories and lists for the classified ads users will be posting on your website.

wpc05

After at least one category with list under it is created ads can be added under it. Here is how it will appear on the website front end.

wpc06

Adding a new classified is an easy task. Click on the desired list in the category where you would like the ad published then click the “Add new Ad in this category” link.

wpc07

Enter the required information and click Save Ad. That is all.

Another WP Classifieds Plugin

This part of the tutorial describes how to use the Another WordPress Classifieds Plugin for your WordPress installation. You can find more about WordPress Classifieds plugins here.

First you will need to have the pugin installed. Download it from the official WordPress plugins directory -> AWPCP. Then have it installed for your WordPress application You can do so via the WordPress admin area -> Plugins -> Add New -> Upload.

wpc01

Browse for the downloaded plugin archive and then click the Install Now button.wpc02

Once the plugin is installed you can immediately activated using the provided link

awpcp01

or do so later via the Plugins section in the WordPress administration area.

When you have activated the plugin a new Classifieds section will be available on the left under your WordPress admin area.

If you are accessing AWPCP for the first time you will be asked to adjust the settings for it according to your needs.

awpcp03

As soon as you have adjusted the settings and saved them the plugin will be active and a default general category for ads is available. Users can now start posting adds on your web site.

awpcp04

Use the Place Ad button then enter all the required information for a new ad. When ready click Continue. This will load the second step where you can upload images to your ads.

awpcp05

When ready click Finish. That is all. You now have AWPCP active and working for your WordPress installation and a new ad posted on your website.

Your Classified Ads

This part of the tutorial describes how to use the Your Classifieds Ads for your WordPress installation. You can find more about WordPress Classifieds plugins here.

Bear in mind that in order for the front end ads posting and the guest users ads posting to work you will need to have the One Quick Post plugin installed and enabled for your WordPress website.

Then you will need to have the Your Classifieds Ads pugin installed. Download it from the official WordPress plugins directory -> Your Classified Ads. And install it via WordPress admin area -> Plugins -> Add New -> Upload.

wpc01

Browse for the downloaded plugin archive and then click the Install Now button.

wpc02

Once the plugin is installed you can immediately activate it using the provided link

awpcp01

or do so later via the Plugins section in the WordPress administration area.

As soon as the plugin is activated a new Classified Ads section will be created in the WordPress administrator backend.

yca01

You can now proceed adding new classifieds for your website via the Add New functionality.

yca02

Advanced Topics

Send Emails Via SMTP

By Default, WordPress uses the PHP Mail function to send its emails. There’s nothing wrong with that but if you want to use a third-party email service, in some cases you will be forced to use SMTP for sending your emails.

To begin, first you need to install a plugin named WP Mail SMTP by following the instructions in our tutorial on how to install WordPress plugins. Once the plugin is installed and activated, a new menu will show up under the Settings section called Email. You will need to navigate to it in order to configure WordPress to work with SMTP.

wsm1

On this screen you will see numerous configuration options available for you:

wsm2

Here’s a list of all of them and what do they configure:

  • From Email – the email address you want to send emails from – [email protected] for example;
  • From Name – the name that your emails will be received from;
  • Mailer – choose whether you want to use the default Mail function or the SMTP;
  • Return Path – check if you want to match the return path for your emails to the sending email;
  • SMTP Host – the hostname for your SMTP server;
  • SMTP Port – the port your server works on;
  • Encryption – if you have SSL/TLS encryption available for that hostname, select it here;
  • Authentication – check if your SMTP server requires authentication;
  • Username – the username for your SMTP server;
  • Password – the password for your SMTP server;

Once you configure those parameters, simply click the Save button at the bottom of the page. That’s it, WordPress is now configured to work with your SMTP Server!

WordPress With Real Cron Job

Because WordPress has to work on all sort of different platforms, OS’s and configurations, it can’t rely that there will be a cronjob service on the server that can handle scheduled tasks. This is why WordPress developers have created a workaround – the wp-cron.php file in your main WordPress folder is hit every time someone loads a page. It then checks if there’s a scheduled task to be done and executes it if necessary.

However, in some cases, this file may become target of a DOS attack, or caching plugins can interfere with its execution which can cause either a lot of server load or the scheduled tasks may not execute properly and timely. This is why, you can substitute this file constant execution with a real cron job.

First, you need to disable the file to be hit every time someone loads your pages. To do this, open thewp-config.php file in your main WordPress folder and add this line at the end, before the closing ?>tag:

define('DISABLE_WP_CRON', true);

Once you do that, you need to setup a real cron job and execute this file with it. You don’t want to trigger it too often – 30 minutes should be fine for most of the websites. To do this, login to your cPanel and go to the Cron jobs tool located in the Advanced tab.

wpcron1

Then, add the following command to be executed every 30 minutes:

/usr/local/bin/php /home/user/public_html/wp-cron.php

You need to replace /user/ with your actual cPanel username. The Cron jobs tool has some of the most common schedules preset, so you can just select Every 30 mintues from the minutes drop-down and place a * symbol in the others.

wpcron3

If you want to, you can set an email to receive the output of your cronjob. We recommend you doing that, to make sure that the task is executing properly. Once you get an email with the wp-cron.php output, you can remove your email address from the field to stop getting those mails.

Limit WordPress Heartbeat

WordPress 3.6 introduced the WordPress Heartbeat API – it allows your browser to communicate with the server when you’re logged into the WordPress admin panel. This functionality allows WordPress to handle things like showing other authors that a post is being edited by another user, plugins can hook up to those “ticks” and show you notifications in real time, etc.

However, even though this is great functionality it may cause issues in certain cases. On different pages, Heartbeat makes checks on different period – on post edit, it makes it every 15 seconds, on your Dashboard – every minute, etc. Each “tick” generates a POST request which adds to the number of your executions and CPU time used.

The API uses the /wp-admin/admin-ajax.php file to make AJAX calls. If you notice a signifficant amount of POST requests by that file, this means that you need to limit the work of Heartbeat or stop it completely.

How to Stop Heartbeat completely

Usually, you can completely disable it if you’re the only person working at any given time in your site and you know that you don’t have any important functionality that heavily relies on it to work properly.

To disable it, go to the functions.php file of your theme and paste these lines right after the opening <?php tag:

add_action( 'init', 'stop_heartbeat', 1 );
function stop_heartbeat() {
wp_deregister_script('heartbeat');
}

This will completely disable this functionalioty and it will no longer add to the executions number and CPU time used in your account.

How to Limit Heartbeat

If you don’t want to stop Heartbeat completely, you can simply limit the execution frequency. You can do this by using a plugin called Heartbeat Control.

Simply install it by following the instructions in our tutorial on How to Install WordPress Plugins and activate it. Then go to Settings -> Heartbeat Control and from the Override Heartbeat frequencydropdown choose 60 seconds. Finally, save the settings and that’s it.

heartbeat1

If you want to, you can set heartbeat to work from a different locations only – like on your post and edit pages for example.

heatbeat2

That’s it, WordPress Heartbeat is now tamed and should not be adding to the number of executions and CPU seconds used when you forget a dashboard tab open.

Disable Post Revisions

It’s a popular WordPress myth that storing multiple post revisions slows down your website. This is not true. WordPress is written smart enough to ignore revisions while rendering the front end and its MySQL queries are written well enough so revisions don’t actually slow them down. However, post revisions take space in your WordPress database. Revisions are practically full copies of your posts, so if you have hundreds of posts this means you have few hundreds revisions stored too.

To sum up, if you need to decrease the size of your WordPress database, removing your post revisions is a great way to do it without sacrificing any actual content. To do this open your wp-config.php file and add the following configuration line to it:

define('WP_POST_REVISIONS', false );

Doing this, however, will only tell your WordPress application to stop storing new post revisions. If you want to delete all the existing ones, it’s a good idea to use the Bulk Delete free plugin.

WordPress SEO

This tutorial will show you how to improve the SEO of your WordPress blog. You can check our Search Engine Marketing tutorial for more information about SEO.

How to SEO WordPress

  • Permalinks – WordPress’ tool for customizing your blog links;
  • Meta descriptions – set a correct meta description for each page/post you make to improve your ranking in the search results;
  • Optimize your images – allow search engines to correctly index your images;
  • Use Headings – the proper structure of your articles will rank your content higher;

How to use Permalinks to optimize your WordPress website

WordPress gives you the freedom to set your links the way you want them to look like. In the administrative area of WordPress go to Settings -> Permalinks. On this page you can choose from several predefined options or use a custom structure for your links.

wrdp_seo1

You can choose the Custom Structure option and enter /%postname%/ for example. This will make your links look like https://yourdomain.com/the-name-of-your-post/. Or you can enter /%category%/%postname%/ if you want to include the name of your category in the URL. You can also add custom text or other WordPress variables. The full list of available variables that you can use in your permalinks can be found at the WordPress official website.

How to optimize your meta descriptions

You should enter the meta description for each one of your pages. Use simple but informative sentences. The search engines will check how relevant your description is to the actual content of your page so  make sure that you describe only the current page and avoid adding irrelevant information in this description.

It is a good practice to categorize your posts in articles. Once you go to the Posts -> Categories page in your admin area, note the description field available for each category. WordPress will take what you enter in this field and insert it as meta description for the category.

wrdp_seo3

How to optimize your images

It is essential to have the “title” and “alt” tags specified for each one of the images you use in your posts. The search engines will then know what this image is supposed to represent. Typing the title and alt tags for each image you use, however, can be a time-consuming task. Instead, you can use the handy SEO Friendly Images plugin. For more information on how to install this plugin, you can check our tutorial on How to install WordPress plugins.

Once you install the plugin, go to Settings -> SEO Friendly Images in your WordPress admin area. On this page you can specify the ALT and TITLE tags for your images. The plugin gives you the option to use internal variables such as %title, %name and %category. With them you can set the ALT and TITLE tags of your images to the title of your post for example. The plugin does the rest. This saves you a lot of time  and keeps your images SEO-friendly .

wrdp_seo2

How to use Headings to optimize your WordPress blog

You should make sure that you use the <h1> tag only for the titles of your posts.

You should use a few <h2> tags and as many <h3> tags as you need for the other headings in your posts. Doing this will allow the search engines to index the important information from your website better. A good document has headings and subheadings, because headings make it easier to determine the subject of the page.

For blog websites the best SEO practice is to set the title of your post in a heading1 tag. Most of the good WordPress templates do that. If not, you should modify the theme in order to achieve a correct output of your pages.

Translate WordPress

WordPress has one of the largest if not the largest communities in the world of CMS applications.This community has translated WordPress into many languages and you can easily change the default language of your installation.

To change the WordPress back and frontend language, open the wp-config.php file in your root folder.

In it locate the following line:

define ('WPLANG', '');

and replace it with:

define ('WPLANG', 'bg_BG');

where bg_BG is the locale code of your country.

WordPress Adsense

With WordPress you can easily add your AdSense code to your blog. In order to do this, first login to the administrative end of your website. Then, go to the Appearance -> Widgets menu.

adsense1

In this page select to drag-and-drop a “Text” widget onto your registered sidebar.

adsense2

Then you should add a title (in our case – Advertisement) and right under it the actual code that you have obtained from Google. Finally, click on the on the “Save” button right under it.

adsense3

Well done! You have just added your AdSense code to your WordPress blog.

WordPress The Loop

The Loop is a term used in the WordPress community to describe the internal cycle used to display each of your posts. Using The Loop, WordPress processes all posts and displays them on the current page, formatted and filtered. Any HTML, PHP or other code placed within The Loop will be repeated on each post.

The most simple example of The Loop is the following code:

<?php if ( have_posts() ): while ( have_posts() ) : the_post(); ?>
<?php endwhile; endif; ?>

The Loop is the main part of each theme – it is the core of each WordPress site. If you find a instruction to place piece of code “within The Loop” you should place it before the endwhile; element that closes the cycle.

Create a WordPress Theme

his tutorial will show you how to create a simple WordPress theme. When building your own theme, you can use our Free WordPress themes for reference.

How to create a basic WordPress theme?

To start building your theme, first create a sub-folder in the wp-content/themes directory in your WordPress folder. For the purpose of this tutorial, we will call the folder “tutorial_theme”. The name of the folder should correspond to the name of the theme you want to create. To do this you can use either your favorite FTP client or the File Manager tool in your cPanel.

Before you start creating the theme, you should decide how the layout of your website will look like. In this tutorial we will build a WordPress theme that consist of a header, sidebar, content area and a footer ,as shown below:

wrdp-theme1(1)

To do this we will have to create the following files into the tutorial_theme directory:

  • header.php – This file will contain the code for the header section of the theme;
  • index.php – This is the main file for the theme. It will contain the code for the Main Area and will specify where the other files will be included;
  • sidebar.php – This file will contain the information about the sidebar;
  • footer.php – This file will handle your footer;
  • style.css – This file will handle the styling of your new theme;

You can either create those files locally with a simple text editor(like notepad for example) and upload them via FTP or you can use the File Manager tool in your cPanel to create the files directly on your hosting account.

Now let’s take a closer look at each file and what it should contain:

The header.php file

In this file you should add the following code:

<html>
<head>
<title>Tutorial theme</title>
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>">
</head>
<body>
<div id="wrapper">
<div id="header">
<h1>HEADER</h1>
</div>

Basically, this is simple HTML code with a single line containing a php code and a standard WordPress function. In this file you can specify your meta tags such as the title of your website, meta description and the keywords for your page.

Right after the title the line we add

<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>">

tells WordPress to load the style.css file. It will handle the styling of your website.

The

<?php bloginfo('stylesheet_url'); ?>

part of the line is a WordPress function that actually loads the stylesheet file.

Next, we have added the beginning of a “div” with class wrapper which will be the main container of the website. We have set class for it so we can modify it via the style.css file.

After that we have added a simple label HEADER wrapped in a “div” with class “header” which will be later specified in the stylesheet file.

The index.php file

<?php get_header(); ?>
<div id="main">
<div id="content">
<h1>Main Area</h1>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<h1><?php the_title(); ?></h1>
<h4>Posted on <?php the_time('F jS, Y') ?></h4>
<p><?php the_content(__('(more...)')); ?></p>
<hr> <?php endwhile; else: ?>
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p><?php endif; ?>
</div>
<?php get_sidebar(); ?>
</div>
<div id="delimiter">
</div>
<?php get_footer(); ?>

The code in this file begins with

<?php get_header(); ?>

which will include the header.php file and the code in it in the main page. It uses an internal WordPress function to do this. We will explain this in details later in this tutorial. Then we have placed a Main Area text to indicate which section of your theme is displayed in this area.

The next few lines consist of a PHP code and standard WordPress functions. This code checks whether you have posts in your blog created through the WordPress administrative area and displays them.

Next, we include the sidebar.php file with this line

<?php get_sidebar(); ?>

In this file you can display your post categories, archives etc.

After this line, we insert an empty “div” that will separate the Main Area and the Sidebar from the footer.

Finally, we add one last line

<?php get_footer(); ?>

which will include the footer.php file in your page.

The sidebar.php file

In the sidebar.php we will add the following code:

<div id="sidebar">
<h2 ><?php _e('Categories'); ?></h2>
<ul >
<?php wp_list_cats('sort_column=name&optioncount=1&hierarchical=0'); ?>
</ul>
<h2 ><?php _e('Archives'); ?></h2>
<ul >
<?php wp_get_archives('type=monthly'); ?>
</ul>
</div>

In this file we use internal WordPress functions to display the Categories and Archives of posts. The WordPress function returns them as list items, therefore we have wrapped the actual functions in unsorted lists (the <ul> tags).

The footer.php file

You should add these lines to the footer.php file:

<div id=”footer”>
<h1>FOOTER</h1>
</div>
</div>
</body>
</html>

With this code we add a simple FOOTER lable. Instead of this code you can add links, additional text, the copyright information for your theme and additional objects.

The style.css file

Add the following lines to the style.css file:

body { text-align: center; }
#wrapper { display: block; border: 1px #a2a2a2 solid; width:90%; margin:0px auto; }
#header { border: 2px #a2a2a2 solid; }
#content { width: 75%; border: 2px #a2a2a2 solid; float: left; }
#sidebar { width: 23%; border: 2px #a2a2a2 solid; float: right; }
#delimiter { clear: both; }
#footer { border: 2px #a2a2a2 solid; }
.title { font-size: 11pt; font-family: verdana; font-weight: bold; }

This simple css file sets the basic looks of your theme. Those lines set the background of your page and surround the main parts of your site with borders for convenience.

At this point your website should look like this:

wrdp-theme2

As we have previously mentioned, internal WordPress functions are often used in the code of the theme. You can take a look at the complete Function Reference at the official website of WordPress for more information about each function.

From now on you can modify the CSS file, add images, animations and other content to your theme in order to achieve the looks you want for your blog!

Add Facebook Like Button

Now, it is easier than ever to add the Facebook famous “Like”/”Recommend” to your posts and increase their popularity.

First, you need to login as administrator to the WordPress admin panel. Then go to Appearance -> Editor.

Then place the following code wherever you want the like button to appear:

<iframe src="https://www.facebook.com/plugins/like.php?href=<?php echo
urlencode(get_permalink($post->id)); ?>&amp;layout=standard&
amp;show_faces=false&amp;width=350&amp;action=like&amp;colorscheme=light"
scrolling="no" frameborder="0" allowTransparency="true" ></iframe>

The final result should look like this:

likebuton

Display Posts From Category

If you want to display posts from a single category in your WordPress theme, you should add the following line below the Loop:

<?php query_posts( 'cat=33' ); ?>

Replace 33 with your category ID. This will filter the Look showing only posts from the category you have selected.

If you want to show more than one category, you can add the IDs separated with comas:

<?php query_posts( 'cat=33,44,55,66' ); ?>

Show Post Author

To display information about the post author, open the single.php file of your WordPress theme and find where the content is displayed:

<?php the_content(''); ?>

After this, add the following lines in your theme:

<?php if ($lw_post_author == "true" && is_attachment() != TRUE) : ?>
<div >
<div >
<?php echo get_avatar( get_the_author_id(), '28' ); ?>
</div>
<div >
<h4>
<?php _e('Author','lightword'); ?>: <a href="<?php the_author_url(); ?>"><?php the_author(); ?>
</a>
</h4>
<?php the_author_description(); if(!get_the_author_description()) _e('No description.
Please update your profile.','lightword'); ?>
</div>
<div >
</div>
</div>
<?php endif; ?>

This will add information about the post author on your site. Simply update your style.css in order to make this block look the way you want.

Change WordPress URL

Sometimes you may need to change the URL of your WordPress site.

For example, it is a common practice to develop the new version of your site in a subfolder and when it is ready to move it into your root directory.

WordPress, however, relies on its URL settings to work correctly.

This means that if you simply move your files and database it will not work properly.

The URL settings are located in the application database. Fortunately, direct database modification can be avoided by using a nice function provided by the WordPress developers named “update_option”.

Simply add these lines to the functions.php file of your theme:

update_option('siteurl','https://www.new-site-address.com');
update_option('home','https://www.new-site-address.com');

Then simply load your site from its new location – it should work just fine.

Note that after you run your site once and you make sure it works you should delete those lines from your functions.php file. The settings are already stored in your database and should not be modified each time your site is loaded.

Display Random Comment

If you want to include a random comment from one of your posts you can use the following code in your theme:

<?php $post_id = 33;
// Put the 'testimonials' id here
$comments = get_comments("post_id=$post_id&status=approve");
if ($comments) { $ndx = mt_rand(1,sizeof($comments)) - 1;
$comment = $comments[$ndx]; }?>
<p>
<?php echo $comment->comment_content; ?>
</p>
<p>
<?php echo $comment->comment_author; ?>
</p>

Replace “33” with the post ID you want to get your comments from. Such technique is often used to get comments from post that asks for feedback for example.

Hide Specific Category

Sometimes, when you display certain posts on your WordPress powered site you may need to hide speciffic categories from posts pages. This is needed because categories are often used as system “markers” in site’s structure.

To do this, enter the following lines above the Loop (check out this tutorial for more information onWhat is The Loop):

<?php if (is_front_page() && !is_paged() 
) $posts = query_posts($query_string . '&cat=-33,-66'); ?>

This prevents posts from categories 33 and 66 from appearing in the list of posts.

Remove WordPress User Bar

In WordPress 3.1 and later versions there is a brand new feature – the admin bar.

It allows you to perform administrative tasks to your blog while browsing through its front end.

Of course it requires from you to be logged in with an username that has admin privileges.

There are many people, however, that would like to disable this feature.

Mainly because it moves your entire website with about half an inch down and creates conflicts with some themes.

Although, this admin bar can be disabled by adding a filter in your functions.php file, the easiest and cleanest way to do this is through the WordPress user configuration page.

Login with your account and then navigate to Users -> Users menu in your left column. Once on this page, hover over the selected user and click on the Edit button that appears.

On the next page, simply remove the “Show Admin Bar when viewing site” check and save the settings. The Admin bar will no longer be displayed on the front end of your blog.

remove-admin-bar1

WordPress Video Tutorials

WordPress Installation Video

WordPress Settings Video

Change Password Video

Edit Your Profile Video

Change Header Video

Manage Categories Video

Add A Post Video

Manage Users Video

Manage Pages Video

Manage Plugins Video

Write Comments Video

Update WordPress Video