Tag - Beginners

Beginner’s Guide to WordPress Database Management with phpMyAdmin


WordPress is written using PHP as its scripting language and MySQL as its database management system. In order to use WordPress, you don’t really need to learn either of them.

However, a very basic understanding of the two could help you troubleshoot problems as well as increase your understanding of how WordPress works (behind the scenes).

In this article, we will explain how WordPress uses the database including an intro to default WordPress database tables.

We will also show you how to manage a WordPress database using phpMyAdmin which will include creating database backups, optimizing the WordPress database, and more.

How to manage WordPress database using phpMyAdmin

This is a comprehensive guide on WordPress database management, so we have added a table of contents for easier navigation:

  • What is a database and how WordPress uses it?
  • What is phpMyAdmin?
  • How to access phpMyAdmin
  • Understanding WordPress database tables
  • Managing WordPress database via phpMyAdmin
  • Creating a WordPress database backup using phpMyAdmin
  • Creating a WordPress backup using a plugin
  • Importing WordPress database using phpMyAdmin
  • Optimizing your WordPress database using phpMyAdmin
  • Fixing WordPress issues using phpMyAdmin
  • Reset WordPress password using phpMyAdmin
  • Adding a new WordPress admin user via phpMyAdmin
  • Changing a WordPress username using phpMyAdmin
  • Other useful phpMyAdmin tricks
  • Securing your WordPress database

What is a Database and How WordPress Uses it?

A database is a system of storing and fetching data in an organized way. Database allows software to manage data in a programmable way.

For example: WordPress uses PHP (programming language) to store and retrieve data from the database.

The information stored in a WordPress database includes posts, pages, comments, categories, tags, custom fields, users, and other WordPress settings. We will elaborate on this later in the tutorial when we cover all WordPress database tables.

When you first install WordPress, it asks you to provide a database name, host, username, and password. This information is stored in the configuration file called wp-config.php.

WordPress database information

During the installation, WordPress uses the information you provide about the database to create tables and store default installation data inside those tables.

After the installation, WordPress runs queries to this database to dynamically generate HTML pages for your website or blog.

This is what makes WordPress extremely powerful because you don’t have to create a new .html file for each page that you want to create. WordPress handles everything dynamically.

Where is my WordPress database stored?

WordPress uses MySQL as its database management system, which is a software installed on your WordPress hosting server. Your WordPress database is also stored on the same server.

This location however is not accessible on most shared hosting environments. However, if you are on a VPS hosting plan or a dedicated server, then you can use command line tools to locate the database.

Most often it is located at the following path:

/var/lib/mysql/your_database_name

However, this could differ from one hosting provider to another.

It is important to keep in mind that you don’t really need to access the database file itself. You can use other tools like phpMyAdmin to manage your database.

What is phpMyAdmin?

PhpMyAdmin is a web-based software that allows you to manage MySQL databases using your web browser. It offers an easy to use interface that allows you to run MySQL commands and database operations.

You can also use it to browse and edit database tables, rows, and fields. It also allows you to import, export, or delete all data inside a database.

How to Access PhpMyAdmin?

PhpMyAdmin comes pre-installed with all top WordPress hosting companies. You can find it under the Databases section of your hosting account’s cPanel dashboard. Below is an example screenshot from Bluehost control panel:

phpMyAdmin in cPanel

Depending on your hosting provider, your cPanel interface may look different than the above screenshot. You would still be able to find phpMyAdmin icon under the databases section.

Clicking on it will open the phpMyAdmin interface where you can select your WordPress database from the left column. After, that phpMyAdmin will display all tables in your WordPress database.

PhpMyAdmin dashboard

Let’s take a look at the WordPress database tables.

Understanding WordPress Database Tables

Each WordPress installation has 12 default tables in the database. Each database table contains data for different sections, features, and functionality of WordPress.

Looking at the structure of these tables, you can easily understand where different parts of your website are stored. Currently, a default WordPress installation creates the following tables:

Note: wp_ before each table name is the database prefix you choose during the installation. It can be different if you changed it at the time of installation.

wp_commentmeta : This table contains meta information about comments posted on a WordPress website. The table has four fields meta_id, comment_id, meta_key, and meta_value. Each meta_id is related to a comment_id. One example of comment meta information stored is the status of comment (approved, pending, trash, etc).

wp_comments : As the name suggests this table contains your WordPress comments. It contains comment author name, url, email, comment, etc.

wp_links : To manage blogrolls create by earlier versions of WordPress or the Link Manager plugin.

wp_options : This table contains most of your WordPress site-wide settings such as: site url, admin email, default category, posts per page, time format, and much much more. The options table is also used by numerous WordPress plugins to store plugin settings.

wp_postmeta : This table contains meta information about your WordPress posts, pages, and custom post types. Example of post meta information would be which template to use to display a page, custom fields, etc. Some plugins would also use this table to store plugin data such as WordPress SEO information.

wp_posts : The name says posts but actually this table contains all post types or should we say content types. This table contains all your posts, pages, revisions, and custom post types.

wp_termmeta : This table allows developers to store custom metadata for terms under their custom taxonomies. For example, WooCommerce uses it to store metadata for product attributes and categories.

wp_terms : WordPress has a powerful taxonomy system that allows you to organize your content. Individual taxonomy items are called terms, and they are stored in this table. For example, your WordPress categories and tags are taxonomies, and each category / tag inside them is a term.

wp_term_relationships : This table manages relationship of WordPress post types with terms in wp_terms table. For example this is the table that helps WordPress determine post X is in Y category.

wp_term_taxonomy : This table defines taxonomies for terms defined in wp_terms table. For example, if you have a term “WordPress Tutorials“, then this table contains the data that says it is associated with a taxonomy called category. In short, this table has the data that helps WordPress differentiate between which term is a category, which is a tag, etc.

wp_usermeta : Contains meta information about registered users on your website.

wp_users : Contains user information like username, password, user email, etc.

Managing WordPress Database using phpMyAdmin

Your WordPress database contains important WordPress settings, all your blog posts, pages, comments, and more. You need to be extremely careful when using phpMyAdmin, or you may end up accidentally deleting important data.

As a precaution, you should always create a complete database backup. This would allow you to restore your database the way it was before.

Let’s take a look at how to easily create a WordPress database backup.

Creating a WordPress Database Backup using phpMyAdmin

To create a backup of your WordPress database from phpMyAdmin, click on your WordPress Database. On the top menu, click on the Export tab.

Export WordPress database

In newer versions of phpMyAdmin, it will ask you for an export method. The quick method will export your database in a .sql file. In the custom method, it will provide you with more options and ability to download backup in compressed zip or gzip archive.

We recommend using the custom method and choosing zip as the compression method. The custom method also allows you to exclude tables from the database.

Let’s say if you used a plugin that created a database table, and you are no longer using that plugin, then you can choose to exclude that table from the backup if you want.

Compression method

Your exported database file can be imported back into a different or the same database using phpMyAdmin’s import tab.

Creating a WordPress Backup using a Plugin

Keeping regular backups of your WordPress site is the best thing you can do for your WordPress security. While the WordPress database contains the majority of your site information, it still lacks several fairly important elements such as template files, images, uploads, etc.

All your images are stored in the uploads folder in your /wp-content/ directory. Even though the database has the information which image is attached to a post, it is useless if the image folder doesn’t have those files.

Often beginners think that the database backup is all that they need. It is NOT true. You need to have a full site backup that includes your themes, plugins, and images.

While most hosting companies claim they have daily backups, we recommend that you keep backups yourself just in case.

Note: If you are on a managed WordPress hosting solution like WPEngine, then they do create daily backups.

For the majority of us who are not on WPEngine, you should use a WordPress backup plugin to set up automated WordPress backups on your site.

Importing a WordPress Database Backup via phpMyAdmin

PhpMyAdmin also allows you to easily import your WordPress database. Simply launch phpMyAdmin and then select your WordPress database.

Next, you need to click on the ‘Import’ link from the top menu.

Import database via phpMyAdmin

On the next screen, click on the Choose file button and then select your database backup file you downloaded earlier.

PhpMyAdmin will now process your backup file upload and import it into your WordPress database. Once finished, you will see a success message.

Database imported successfully

Optimizing your WordPress Database in phpMyAdmin

After using WordPress for a while, your database becomes fragmented. There are memory overheads which increase your overall database size and query execution time.

MySQL comes with a simple command that allows you to optimize your database. Simply go to phpMyAdmin and click on your WordPress database. This will show you a list of your WordPress tables.

Click on the check All link below the tables. Next to it, there is a “With Selected” drop down, you need to click on it and choose Optimize table.

Optimize WordPress database tables

This will optimize your WordPress database by defragmenting selected tables. It will make your WordPress queries run a little faster and slightly reduce the size of your database.

Fixing WordPress Issues using PhpMyAdmin

As we mentioned earlier, phpMyAdmin is a handy tool for troubleshooting and fixing some common WordPress errors and issues.

Let’s check out some common WordPress issues that can be easily fixed using phpMyAdmin.

Reset WordPress Password Using PhpMyAdmin

If you forgot your WordPress admin password and cannot recover it via lost password email, then this method allows you to quickly reset WordPress password.

First, launch the phpMyAdmin and select your WordPress database. This will display your WordPress database tables where you need to browse next to wp_users table.

Browse user table

Note: Table names in your WordPress database may have a different table prefix than the one we are showing in our screenshot.

You will now see the rows in your WordPress users table. Go ahead and click on the edit button next to the username where you want to change the password.

Edit user

PhpMyAdmin will show you a form with all the user information fields.

You will need to delete the value in the user_pass field and replace it with your new password. Under the function column, select MD5 from the drop-down menu and click on the Go button.

Change user password

Your password will be encrypted using the MD5 hash and then it will be stored in the database.

Congratulations! You have successfully changed your WordPress password using phpMyAdmin.

Now some of you may be wondering why did we select the MD5 hash to encrypt the password.

In the older version, WordPress used MD5 hash to encrypt passwords. Since WordPress 2.5, it started using stronger encryption technologies. However, WordPress still recognizes MD5 to provide backward compatibility.

As soon as you log in using a password string stored as an MD5 hash, WordPress recognizes it and changes it using the newer encryption algorithms.

Adding a New Admin User to WordPress using PhpMyAdmin

Let’s suppose you have access to the WordPress database but not the WordPress admin area. While you can change the admin user password, it will prevent the other admin user from using their account.

An easier solution would be to add a new admin user via phpMyAdmin.

First, you need to launch the phpMyAdmin and then select your WordPress database. This will show your WordPress database tables where you need to click on the ‘Browse’ link next to wp_users table.

Browse user table

phpMyAdmin will now show you the rows inside the wp_users table. Go ahead and click on the ‘Insert’ link from the menu on the top.

Insert new row in WordPress users table

This will bring up a form that you need to fill up to add a new user to your WordPress site.

Fill user form

Here is how you need to fill each field in this form.

  • ID – You can ignore this one as this is automatically generated.
  • user_login – This will be your WordPress username that you’ll use to login.
  • user_pass – This is your WordPress password you need to enter the password and select MD5 in the function column.
  • user_nicename – This is the URL friendly username you can use the as your login.
  • user_email – Enter a valid email address as you may need it to recieve password reset and WordPress notification emails.
  • user_url – Add your website URL or you can leave it blank.
  • user_registered – You need to select the CURRENT_TIME in the function column to automatically insert current time here.
  • user_activation_key – You can leave this field blank as well it is used to approve user registeration.
  • user_status – You can leave this field blank as well.
  • display_name – You can enter the user’s full name as you want to be displayed on the articles. You can also leave it blank.

After filling in the form, click on the Go button to insert it into your WordPress database. PhpMyAdmin will now run the MySQL query to insert the data.

We have added the user, but that user does not have an administrator user role on your WordPress site. This value is saved in another table called wp_usermeta.

Before we can make this user an administrator, we will need to find the user ID. Simply click on the ‘Browse’ link next to wp_users table and you will see a row containing your newly added user with their user ID.

Find user ID

Note down the user ID as you’ll need it in the next step.

Now, let’s open the wp_usermeta table by clicking on the Browse link next to it.

Browsing wp_usermeta table

Next, you need to click on the Insert link at the top to add a new row to the table.

Insert new row to usermeta table

You’ll now see a form to enter a new row. This is where you’ll tell WordPress that the user you created earlier has the administrator user role.

Adding administrator user role via usermeta

Here is how you’ll fill in this form.

  • umeta_id – You need to leave it blank as it is automatically filled in.
  • user_id – Enter the user ID you copied earlier.
  • meta_key – You need to enter wp_capabilities in this field. However, you may need to replace wp_ if your WordPress table names use a different prefix.
  • meta_value – You need to enter the following serialized value:
    a:1:s:13:"administrator";s:1:"1";

Finally, click on the Go button to save your changes.

Next, we need to add another row to define the user level. Click on the Insert link on the top menu to add another row to the usermeta table.

Adding the user level meta field

Here is how you’ll fill in this form.

  • umeta_id – You need to leave it blank as it is automatically filled in.
  • user_id – Enter the user ID for your newly added user.
  • meta_key – You need to enter wp_user_level in this field. However, you may need to replace wp_ if your WordPress table names use a different prefix.
  • meta_value – Here you need to enter 10 as the user level value.

Don’t forget to click on the Go button to insert the data.

That’s all, you can now visit the WordPress admin area and log in with your newly added admin user.

Change a WordPress Username via PhpMyAdmin

You may have noticed that while WordPress allow you to change user’s full name or nickname, it does not allow you to change the username.

Now a lot of users end up choosing usernames during the installation that they may later want to change. Here is how you can do this via phpMyAdmin.

Note: there is an easier way to change WordPress username using a plugin.

First, you need to launch the phpMyAdmin from your hosting account’s cPanel dashboard. After that, you need to select your WordPress database.

PhpMyAdmin will show your WordPress database tables. You need to click on the ‘Browse’ link next to wp_users table.

Browse user table

This table will now list all the registered users on your website. Click on the edit link next to the username that you want to change.

Edit user data via phpMyadmin

PhpMyAdmin will now show you the user data. You need to locate the user_login field and change the value to the username you want to use.

Change WordPress username in phpMyAdmin

Don’t forget to click on the Go button to save your changes. You can now visit your website and login with your new username.

Other Useful PhpMyAdmin Tricks

Your WordPress database is the engine behind your website. With phpMyAdmin you can tweak settings to improve performance, fix issues, or simply change things that cannot be changed from inside WordPress admin area.

Following are just a few more tricks you can use with phpMyAdmin.

  • Deactivate all WordPress plugins
  • Change WordPress theme via phpMyAdmin
  • Duplicate WordPress database via phpMyAdmin
  • Find and replace text in WordPress database

Securing your WordPress Database

Before we get into this, we want to emphasize that every site can be hacked. However, there are certain measures you can take to make it a little harder.

First thing that you can do to is to change WordPress database prefix. This can significantly reduce the chances of SQL injection attacks on your WordPress database because often hackers target sites in masses where they are targeting the default wp_ table prefix.

You should always choose a strong username and password for your MySQL user. This will make it difficult for someone to get access to your WordPress database.

For WordPress security, we strongly recommend that you use Sucuri. It is the best WordPress security plugin that would catch any attempts at MySQL injection even before it reaches your website.

We hope that this guide helped you learn WordPress database management and how to use phpMyAdmin.

If you are the sort of person who likes to learn how things work behind the scenes, then you would love our guides on how WordPress actually works and how WordPress plugins work.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post Beginner’s Guide to WordPress Database Management with phpMyAdmin appeared first on WPBeginner.



Source link

How to Add a Shortcode in WordPress? (Beginner’s Guide)


Shortcodes are an easy way to add dynamic content into your WordPress posts, pages, and sidebars.

Many WordPress plugins and themes use shortcodes to add specialized content like contact forms, image galleries, sliders, and more.

In this article, we will show you how to easily add a shortcode in WordPress. We will also show you how to create your own custom shortcodes in WordPress.

Adding a shortcode in WordPress

What are Shortcodes?

Shortcodes in WordPress are code shortcuts that help you add dynamic content in WordPress posts, pages, and sidebar widgets. They are displayed inside square brackets like this:

[myshortcode]

To better understand shortcodes, lets take a look at the background of why they were added in the first place.

WordPress filters all content to make sure that no one uses posts and page content to insert malicious code in the database. This means that you can write basic HTML in your posts, but you cannot write PHP code.

But what if you wanted to run some custom code inside your posts to display related posts, banner ads, contact forms, galleries, etc?

This is where Shortcode API comes in.

Basically, it allows developers to add their code inside a function and then register that function with WordPress as a shortcode, so users can easily use it without having any coding knowledge.

When WordPress finds the shortcode it will automatically run the code associated with it.

Let’s see how to easily add shortcodes in your WordPress posts and pages.

Adding a Shortcode in WordPress Posts and Pages

First, you need to edit the post and page where you want to add the shortcode. After that, you need to click on the add block button to insert a shortcode block.

Adding shortcode block in WordPress

After adding the shortcode block, you can simply enter your shortcode in the block settings. The shortcode will be provided by various WordPress plugins that you might be using such as WPForms for contact forms, OptinMonster for email marketing forms, WP Call button for inserting a click to call button, etc.

Insert shortcode in the block editor

To learn more about using blocks, see our Gutenberg tutorial for more details.

You can now save your post or page and preview your changes to see the shortcode in action.

Adding a Shortcode in WordPress Sidebar Widgets

You can also use shortcodes in WordPress sidebar widgets. Simply visit the Appearance » Widgets page and add the ‘Text’ widget to a sidebar.

Now you can paste your shortcode inside the text area of the widget.

Adding shortcode in sidebar widget

Don’t forget to click on the ‘Save’ button to store your widget settings.

After that, you can visit your WordPress website to see the live preview of the shortcode in the sidebar widget.

Adding a Shortcode in Old WordPress Classic Editor

If you are still using the old classic editor in WordPress, then here is how you can add shortcodes to your WordPress posts and pages.

Simply edit the post and page where you want to add the shortcode. You can paste the shortcode anywhere inside the content editor where you want it to be displayed. Just make sure the shortcode is in its own line.

Shortcode classic editor

Don’t forget to save your changes. After that you can preview your post and page to see the shortcode in action.

How to Add a Shortcode in WordPress Theme Files

Shortcodes are meant to be used inside WordPress posts, pages, and widgets. However, sometimes you may want to use a shortcode inside a WordPress theme file.

WordPress makes it easy to do that, but you will need to edit your WordPress theme files. If you haven’t done this before, then see our guide on how to copy and paste code in WordPress.

Basically, you can add a shortcode to any WordPress theme template by simply adding the following code.

<?php echo do_shortcode("[your_shortcode]"); ?>

WordPress will now look for the shortcode and display its output in your theme template.

How to Create Your Own Custom Shortcode in WordPress

Shortcodes can be really useful when you want to add dynamic content or custom code inside the WordPress post and pages. However, if you want to create a custom shortcode, then it requires some coding experience.

If you are comfortable with writing PHP code, then here is a sample code that you can use as a template.

// function that runs when shortcode is called
function wpb_demo_shortcode()  

// Things that you want to do. 
$message = 'Hello world!'; 

// Output needs to be return
return $message;
 
// register shortcode
add_shortcode('greeting', 'wpb_demo_shortcode'); 

In this code, we first created a function that runs some code and returns the output. After that, we created a new shortcode called ‘greeting’ and told WordPress to run the function we created.

You can now use add this shortcode to your posts, pages, and widgets using the following code:

[greeting]

It will run the function you created and show the desired output.

Now let’s take a look at a more practical usage of a shortcode. In this example, we will display a Google AdSense banner inside a shortcode.


// The shortcode function
function wpb_demo_shortcode_2()  

// Advertisement code pasted inside a variable
$string .= '<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle"
     style="display:block; text-align:center;"
     data-ad-format="fluid"
     data-ad-layout="in-article"
     data-ad-client="ca-pub-0123456789101112"
     data-ad-slot="9876543210"></ins>
<script>
     
</script>';

// Ad code returned
return $string; 


// Register shortcode
add_shortcode('my_ad_code', 'wpb_demo_shortcode_2'); 

Don’t forget to replace the ad code with your own advertisement code.

You can now use the [my_ad_code] shortcode inside your WordPress posts, pages, and sidebar widgets. WordPress will automatically run the function associated with the shortcode and display the advertisement code.

Shortcodes vs Gutenberg Blocks

We’re often asked by users about the differences between shortcode vs the new Gutenberg blocks.

Basically if you find shortcodes useful, then you’ll love WordPress editor blocks. Blocks allow you to do the same thing but in a more user-friendly way.

Instead of requiring users to add a shortcode for displaying dynamic content, blocks allow users to add dynamic content inside posts / pages with a more intuitive user interface. A lot of popular WordPress plugins are switching to using Gutenberg blocks instead of shortcodes because they’re more beginner friendly.

We have put together a list of the most useful Gutenberg block plugins for WordPress that you may want to try.

If you want to create your own custom Gutenberg blocks, you can follow our step by step tutorial on how to create custom Gutenberg blocks in WordPress.

We hope this article helped you learn how to add a shortcode in WordPress. You may also want to see our guide on the best drag & drop WordPress page builder plugins, and how to create a custom WordPress theme without writing any code.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Add a Shortcode in WordPress? (Beginner’s Guide) appeared first on WPBeginner.



Source link

How to Host a Website (Simple Guide for Beginners) in 2019


Do you want to learn how to host a website? Self-hosted website builders like WordPress offer you full freedom to build any kind of website.

The challenge is that most beginners don’t know the best way to host a website. Many even believe that it requires special technical skills to host their own websites.

That’s simply not true.

If you choose the right approach, then you can easily host your own website within just a few minutes. In most cases, it is just as easy as creating a facebook account.

In this beginner’s guide, we’ll show you the exact steps on how to host a website without learning any technical skills.

We will also explain how it all works behind the scenes. This would help you gain a basic understanding of different ways to host a website.

Ready? Let’s get started.

How to host a website

Here is what you’ll learn in this guide.

What Does it Mean to Host a Website?

Hosting a website means that you put your website files on a special computer called server. This computer makes your website files publicly accessible on the internet, so anyone can visit it.

In order for other people around the world to see the website, these special computers have a particular set of software installed. This software is called a web server.

A web server’s basic job is to receive incoming requests and respond by sending the requested page to the user’s browser.

Hosting a website

Now all of this may sound like bunch of technical jargon, and it is.

However, you don’t need to learn how to do all these things in order to host your website. Luckily, there are thousands of companies that offer this as a service (at very low cost).

All websites on the internet use a web hosting company to host their websites. Even tech giants like Netflix (hosted on Amazon) and PayPal (hosted by Google Cloud hosting) use third-party service providers for their hosting.

There are only a handful of companies like Google, Microsoft, and Amazon that completely host all their services on their own platforms.

They can do this because they have the technical and financial resources to take on such a huge task. All other businesses (including us) use a web hosting company to host their website.

What Do You Need to Host a Website

You will need the following two things to host a website.

  • Web hosting service provider
  • Domain name

Web hosting service providers offer you ready-to-use web servers to host your website. They take care of all the technical stuff and provide website owners with easy to use tools to manage their hosting.

Now, how do users reach your self-hosted website? This is where domain names come in.

A domain name is the address of your website that people type in the browser to visit your website. For example, wpbeginner.com will bring you to this website.

Basically, a domain name is a human-friendly way to connect user’s browsers to the website server associated with that domain name. To learn more, see our guide on what is a domain name and how do domains work.

how domain names work

You can purchase a domain name from one of these top domain registrars. These are companies licensed to sell domain name registrations.

To understand the relationship between hosting and domains, see our guide on the difference between web hosting and domain name.

Note: later in this article, we will show you how to get a domain name for free.

But first, let’s take a look at different types of web hosting plans and evaluate which one would be the right fit to host your website.

Types of Website Hosting Services

Not all websites are the same. Some are smaller and have low traffic while others are larger with more content and visitors.

A smaller website requires fewer resources. On the other hand, a larger and more popular website will need more resources to run efficiently.

Website hosting companies provide different types of hosting offers designed to address specific website needs. Here are some of the most common hosting services.

1. Shared Hosting

A shared hosting service is suitable for small websites, blogs, and small businesses who are just starting out.

They are able to keep their costs down by allowing multiple websites to share the same server resources. This makes hosting your website affordable.

Pricing: Starting from 2.75 per month to $7.99 per month

Suitable for: Starting a new blog, small business website

Our recommended shared hosting provider: Bluehost

To learn more see our guide on the truth about best shared web hosting.

2. VPS Hosting

VPS hosting (Virtual Private Server hosting) is still a shared hosting environment. However, it offers a flexible set of resources to handle large traffic spikes.

You get a partitioned of private server for your website that you can manage from your hosting control panel. This gives you the best of both worlds, the low cost of shared hosting with the flexibility of dedicated resources.

Pricing: Starting from $29.99 / month

Suitable for: Medium-sized businesses, popular blogs, and eCommerce stores.

Our recommended VPS hosting company: HostGator

To learn more, see our article about when you need VPS hosting for your site.

3. Managed WordPress Hosting

Managed WordPress hosting is a specialized hosting service made specifically for WordPress. It is like a concierge service for your WordPress website.

On a managed hosting platform, the hosting company takes care of updates, backups, and caching of your website. This allows you to focus on creating content and growing your business.

Pricing: Starting from $35.00 per month

Suitable for: Popular blogs, business websites, membership websites

Our recommended managed WordPress hosting company: WP Engine

For more details, see our article explaining when do you really need a managed WordPress hosting.

4. Dedicated Hosting

A dedicated server hosting gives you the entire server dedicated to your own website. You get all the resources of the server, advanced tools for server management, ability to install your own software and even your own operating system.

You’ll be managing your own server which may require some technical skills. It is an advanced option for larger websites that need high-performance to tackle higher traffic volume.

Pricing: Starting from $79.99 month

Suitable for: Enterprise level businesses, hugely popular websites, eCommerce stores

Our recommended Dedicated hosting company: SiteGround or HostGator

Note: We use HostGator custom dedicated servers to host the WPBeginner website.

Choosing The Right Plan to Host a Website

As you can see, all different hosting plans come with different server configuration and pricing. You’ll need to choose a plan that suits your needs and budget.

At WPBeginner, we recommend users to start with a low cost shared hosting plan and then upgrade as their business grows. This allows you to save money and only pay for the services that you actually need.

Shared hosting plans start from $7.99 per month (paid annually) and $14.99 for a domain name.

Now if you are just starting out, then this is still a significant investment.

Luckily, Bluehost has agreed to offer our users a discount on hosting and free domain name. Basically, you’ll be able to get started for $2.75 per month.

They are one of the largest hosting companies in the world and an officially recommended WordPress hosting provider.

→ Click Here to Claim This Exclusive Bluehost Offer ←

For other shared hosting plans, see our comparison of the best hosting companies.

Once you have signed up for a hosting account, the next step is to create your website. For detailed instructions, see our guide on how to make a website.

How Much It Cost to Host a Website

So far we have covered the costs of web hosting companies. However, your costs of hosting a website may vary depending on several factors.

The first thing is the hosting plan you choose. We recommend starting with smaller shared hosting plans and then upgrade as your business and website grows.

Once you start building a website, you may need to spend money on other things as well such as website templates, software extensions, and other services.

Your goal would be to only buy what you actually need and use free tools whenever you can.

We have an excellent guide on the cost of building a WordPress website and how to avoid overspending.

How to Host a Website on Your Computer

We are often asked by our users if they can host a website on their own computer.

Yes, you can.

However, the only reason you should host a website on your computer is when you want to test a site locally before putting it on the internet.

A lot of beginners find it useful to learn web development, WordPress, and coding by installing a local server on their computer.

See our tutorials on how to set up local server on Windows and Mac.

This will allow you to install a local server without making it publicly available.

We don’t recommend using a local server to host a website and make it publicly available. However, we will show you how to do that for users who are feeling adventurous.

Putting Your Local Host Server Online

Once you host a website on your local server, it will only be available to you. You’ll need to change its settings to put your website on the internet.

First, locate your web server software’s configuration file called httpd.conf.

If you are using WAMP on Windows, then you’ll find it under C:wampbinapacheapache[version#]conf] folder.

MAMP users on Mac will find it inside /Applications/MAMP/conf/apache/ folder.

You can open this file using a plain text editor like Notepad or TextEdit. After that, you need to find the line that begins with

Listen 80

You need to replace it with your IP address and port number. You can find your IP address by simply Googling ‘what is my ip address’ it will show you a numeric string separated by dots. Here’s an example of what that code should look like with your IP:

Listen 64.233.160.1:80

Next, you need to find the following line:

ServerName localhost:80

Go ahead and change it by replacing localhost:80 with your IP address.

ServerName 64.233.160.1

Next, you need to find the following line for WAMP:

<Directory "c:/wamp/www/">

If you are using MAMP, then look for the following line:

<Directory "/Applications/MAMP/htdocs">

Below this line you’ll see the access permissions, which you need to replace with the following:

Order Allow,Deny
Allow from all

You can now save your configuration file and restart your local server with the new permissions.

Now anyone can use your IP address to access your website instead of localhost. This is not an ideal situation as it would be hard for your users to remember the IP address.

That’s where domain names come in handy.

Pointing Your Domain Name to a Locally Hosted Website

Pointing your domain name to a website that you are hosting on your own computer will allow users to access it as they would do with any other site.

First, you need to edit your domain name’s DNS settings. We’re using Domain.com in our screenshots below:

Editing DNS settings for your domain name

After that, you need to edit the A name record with @ sign as the Name. If you don’t have one, then click on Add new record button to proceed.

Adding A record for your domain

In the value field, you need to enter your computer’s IP address and click on the Update DNS button to save your changes.

If the computer with your local server is connected to the internet directly, then you are all done.

However, if your computer is connected to the internet via router then you need to forward ports. To do that, you need to login to your router’s admin interface by entering the router’s IP address in your browser address bar.

Depending on the manufacturer, your router interface may look slightly different. You will need to find the option labeled port forwarding, virtual server, or NAT.

Port forwarding

Next, you need to forward web or HTTP traffic to port 80. In the IP address field, you need to enter the IP address of your computer on the local network. This IP address is the internal address that identifies your computer on the local network.

After that, you need to apply the changes and restart your router.

Disadvantages of Hosting a Website by Yourself

Hosting your website on a local computer is a bad idea. This is why even the tech giants with enough resources, skills, and know-how prefer to go with a hosting service provider.

Following are just a few disadvantages of hosting a website on local computer.

  • In order to run a web server, you need to put it on a computer connected to a high-speed internet connection 24 hours a day.
  • You also need to install updates for the web server software, keep backups, plan on a backup server, and more.
  • The computer hosting your website will also be open to hacking attempts, malware injection, and DDOS attacks. This could also affect the security of all other computers on your network.
  • You will need to purchase a static IP address from your internet service provider, which will cost you extra.

Doing all this will require a lot of time, effort, and technical skills. This is why it is a bad idea to host your website on a local computer by yourself.

FAQs about Website Hosting

Having helped thousands of beginners start their own websites, we have heard every possible question. Following are some of the most commonly asked questions from people who want to host a website.

1. Why do I need a hosting provider to host a website?

Hosting service providers specialize in maintaining a platform to serve websites. They have engineers and system administrators in their staff that monitor their servers 24/7.

This allows you to focus on building your website and growing your business instead of managing server software.

2. Can I buy a domain name and hosting from two companies?

Yes, you can. However, buying them from the same company allows you to manage both of them under the same dashboard. Also some providers like Bluehost even offer a free domain as an incentive to use their service.

3. Can I buy a domain name and host my website later?

Yes, you can buy a domain name alone. However, it will not be pointing to your website until you choose a hosting provider.

We recommend Domain.com for registering a domain name. They offer beginner friendly domain management tools, which will make it easy to connect your domain to any hosting provider later.

4. Can I host my website on my local computer and later move it to a hosting provider?

Yes, you can do that. However, if you are serious about making a website, then it is better to start with a hosting provider.

5. Can I host a website with one provider and then change it to another provider?

Yes, you can move your website to any other hosting company at any time. See our article on how to move your website to a new host for detailed instructions.

6. Where do I host my website?

There are so many hosting companies out there, that it becomes difficult for beginners to make the right choice.

Over the years, we have worked with all the top hosting companies on the market. This has given us insights into what makes a good hosting platform.

For starter websites, we recommend Bluehost. They automatically install WordPress, and they offer a beginner friendly dashboard, built-in caching, security, and more. On top of it, they are offering WPBeginner readers discount on hosting + free domain name.

For more recommendations, see our complete list of the best hosting companies with their pros and cons.

There are few companies offering free web hosting, but we recommend that you be very careful about those.

We hope this article helped you learn how to host your website. You may also want to see our guide on how to get a free business email address for your website.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.



Source link

How to Change Your Password in WordPress (Beginner’s Guide)


Do you want to learn how to change your WordPress password? Sometimes you might forget your password or need to change it for security reasons.

While there is a lost password link on the login page that lets you reset your password, sometimes the WordPress password reset email never makes it to your inbox because your WordPress hosting company does not have it configured properly.

Other times, you might want to force change the WordPress password for every user on your website due to security reasons.

In this beginners guide, we will show you four different ways to change the WordPress password to cover every possible scenario.

How to Change Your Password in WordPress

Before You Change Your WordPress Password

We can’t emphasize enough that passwords are your first line of defense against hacking attempts.

A lot of times users end up using a weak password because it’s easy to remember. Please don’t do that. You can use one of the many free and secure password managers.

Sometimes it might be tempting to share your WordPress passwords with team members or even contract developers. You should never do that.

Instead, we recommend creating a new user account with the right user role, so you can manage permissions.

This way you can easily delete their account when they’re no longer part of your team without having to change your main password.

That being said, let’s take a look at different ways to change your WordPress password.

How to Change Your WordPress Password in 2 Minutes

This is the easiest way to change your WordPress password.

First thing you need to do is login to your WordPress website. You can do this by entering your WordPress login URL (for example, https://example.com/login/) in your browser.

Once you are logged in, go to Users » Your Profile from your WordPress menu.

Your Profile Page in WordPress

On the WordPress profile, you need to scroll down to the Account Management section where you will see New Password option. Go ahead and click on the ‘Generate Password’ to add a new password.

Generate Password in WordPress

WordPress will automatically create a strong password for you.

Auto Password in WordPress

You can continue with this strong password or change it with a new password of your own.

After that, click the ‘Update Profile’ button to save your new password.

Create a Strong WordPress Password and Save it

Once done, you will see a Profile Updated notification on the top. WordPress will also send you a password change notification in your email inbox.

WordPress Profile Updated with New Password

How to Reset Your WordPress Password When Locked Out

The above method lets you change your password when you have access to your WordPress dashboard.

But what if you lost your password and cannot login?

Don’t panic, there is a super easy way to recover your lost password in WordPress.

You can simply go to the WordPress login page (https://example.com/wp-login.php) and click on the ‘Lost your password?’ link.

Recovering lost password in WordPress

After clicking on that, it will take you to the password reset page. You need to either enter your username or email address to reset the password on your account.

WordPress password recovery screen

Once done, WordPress will send a password reset link to the email address associated with your user account.

For more details, see our guide on how to recover a lost password in WordPress.

How to Change the WordPress Password from Database

The ‘Lost Password’ method above is beginner friendly, but sometimes you won’t be able to use that method if you don’t have access to the email address associated with the account or if your WordPress site fails to send an email.

If such a situation arises, then you will need to reset your WordPress password directly in the database. The easiest way to do that is by using phpMyAdmin.

First, you need to login to your WordPress hosting account’s control panel. After that, click on the phpMyAdmin option under the Databases section.

phpMyAdmin in cPanel

Note: your screen might look different because each hosting provider have their own control panel. If you are having a hard time locating the phpMyadmin link, then contact your hosting support.

After you launch the phpMyAdmin app, you will see a list of all your databases. You need to select the database associated with your WordPress site.

Select your WordPress database

After that, you will see the list of tables in your WordPress database. You need to look for the wp_users table in this list and click on the ‘Browse’ link next to it.

Browse user table

This will show you a list of all users in your WordPress site. On this page, you need to click on the edit link next to your user account.

Edit user account in phpMyAdmin

PhpMyAdmin will show you a form with all the user information fields.

You will need to delete the value in the user_pass field and replace it with your new password. Under the function column, select MD5 from the drop-down menu and click on the Go button.

Change password

That’s all you have successfully changed your WordPress password.

For more details, see our guide on how to reset a WordPress password from phpMyAdmin.

How to Force Change WordPress Password for all Users

If your website was hacked, or your industry has certain data compliance regulation, then you might need to force change the WordPress password for all users.

This can be easily done using a Password Expiration plugin.

We have a step by step guide on how to force change passwords in WordPress.

We hope this article helped you to learn how to change your password in WordPress. You may also want to see our step by step guide on WordPress security for beginners.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.



Source link

How to Add Nofollow Links in WordPress (Beginner’s Guide)


Are you wondering how to add nofollow links in WordPress? When you link to an external website, search engines pass a small part of link authority from your website to the other website.

Since you don’t own or control those third-party websites, it is usually a SEO best practice to add nofollow attribute to those links.

In this article, we’ll explain what is nofollow links, and how you can add nofollow links in WordPress posts, pages, and navigation menus.

How to Add Nofollow Links in WordPress - Simple Guide for Beginners

Here’s a quick overview of what you’ll learn in this article:

A nofollow link is a type of link that tells search engines to not pass any link authority from your page to the other website that you’re linking to. You can turn any link into a nofollow link by adding the following link attribute: rel=”nofollow”.

Links or backlinks are an important search engine ranking factor.

When you link to a website, search engines consider that as a ranking signal, and they will pass a small portion of your page authority (link juice) to the other website.

Some SEO experts believe that by making external links nofollow, their own website will rank higher.

How to Check if a Link is Nofollow?

All nofollow links must contain the rel=”nofollow” HTML attribute.

Here’s an example HTML code of a nofollow link:

<a href="https://example.com" rel="nofollow">Google</a>

To check whether a nofollow attribute is added to a link on a website, you need to take your mouse to that link, right click on it, and then select Inspect on your browser.

Check nofollow attribute in the link

Your browser window will now split into two parts.

In the bottom window, you will be able to see the HTML source code of the link along with the nofollow attribute.

As a general best practice, you should add nofollow to all external websites that you don’t trust.

It’s completely acceptable and actually recommended to link to authority websites like Wikipedia, WPBeginner, New York Times, etc without the nofollow attribute because linking to authority sites help you add credibility to your own website.

However we always recommend users to nofollow less credible websites or websites that you simply don’t trust.

The following are some cases when you should always add nofollow attributes to the links:

1. Affiliate and Sponsored Links

Most bloggers make money online using affiliate marketing.

Affiliate links are tracking links for products and services that you recommend and get referral commissions for if someone purchases your link.

Whether you’re using a direct affiliate link or cloaking it using Pretty Links, you should always add nofollow attribute to affiliate links.

Another popular way bloggers make money is by adding sponsored links. You should always add nofollow to sponsored links because otherwise search engines may consider your site as selling links / spammy.

2. External Links

Sometimes, you may link to an external source to provide a reference to your statement. Since you don’t control the content on those websites, you should consider adding nofollow to them.

In simple words, you are telling the search engines that you are linking to a source, but it is not something you can vouch for.

Note: You don’t need to nofollow a link to an authority website.

3. Sidebar Links

Some bloggers add a list of external or affiliate links to the sidebar of their WordPress blog. These external links can be from authority sites or websites that they trust.

The problem is every time a new page is created on your site, you are creating a new backlink for those websites from your sidebar.

It is important to make these links nofollow and make sure that you are not passing the SEO juice from every page to certain links.

Since Gutenberg is a new WordPress content editor, the old nofollow plugins for WordPress are not yet compatible with it.

Currently, the only way to add nofollow links in Gutenberg is to do it manually.

Let’s take a look at the step by step process on how to add nofollow links in WordPress posts or pages with Gutenberg.

First, you need to go to Posts » Add New from the left sidebar of your admin panel.

On this page, you need to select the text that you want to add a link to, and then click on the “anchor / link” icon.

select text to add link in Gutenberg Editor

This will open a text field just below the selected text. You can paste the external link directly in the box.

If you want the link to open in a new tab, then you need to click on the down arrow icon. This will open a menu where you have to click on the “Open in New Tab” toggle box.

Add external link to the textbox

Once done, you can click on the apply or Enter icon to add the link.

To add the nofollow attribute to your link, you need to select the block containing your link and then click on the 3 vertical dots icon present at the top bar.

Select edit as HTML option from the top bar

This will open a menu where you need to click on the Edit as HTML option.

You will now see the HTML code of your link. Go ahead to add the rel=”nofollow” attribute to the link element.

rel nofollow attribute to link

If you see the rel=”noopener noreferrer” attribute in the HTML code, then add a space after noreferrer and paste nofollow after that.

Once done, you can click on the 3 vertical dots icon again and select the Edit visually option to go back to the visual format.

Select edit visually option

This will convert your normal link to a nofollow link. You can follow the same process for adding nofollow attribute to all other external links.

Although it is recommended to upgrade to the newer version of WordPress, some users still prefer to use the Classic Editor for writing their posts.

Unlike the default editor, you can easily add nofollow links in the Classic Editor with the help of a plugin.

First thing you need to do is install and activate the Title and Nofollow For Links plugin. You can follow our guide on how to install a WordPress plugin for help.

This plugin works out of the box, and there are no settings for you to configure.

Head over to Posts » Add New to create a new post. You need to add some text to the post editor and select the text that you want to link. Next, click on the Link icon present in the toolbar.

Add Link to WordPress Classic Editor

After that you can add the external link to the textbox field below and click on the gear icon to open the Link options.

This will open up a modal window where you will see a nofollow checkbox just below the “Open link in a new tab” option.

Go ahead to select the Add rel=”nofollow” to link checkbox and then click on the Update button.

Add Nofollow attribute to a link in WordPress Classic Editor

This allows you to add a nofollow attribute to any link when writing a post. This is also useful for users who are not confident with editing HTML code.

Most bloggers select the “Open link in a new tab” checkbox as well when adding an external link. This is a great way to reduce bounce rate and keep your visitors from leaving your website.

You have already learned how to add nofollow links in the Gutenberg editor manually. However, that method is only useful when you want to add the nofollow attribute to some of your links.

If you have a lot of external and affiliate links in your post, then you should switch to the Code Editor to add nofollow attribute faster.

Open code editor to edit external links

Simply, click on the 3 vertical dots icon, present at the top-right corner of the page. This will open a dropdown menu where you need to select the Code Editor option.

You will now see the HTML code of the page. Next, search for the external and affiliate links and then, add the nofollow attribute to all of them.

Add nofollow to external links

Once done, you need to click on the “Exit Code Editor” link to revert to the visual editor.

If you’re using the Classic Editor, then you can easily use a plugin to add nofollow links. However, you can also add nofollow links manually.

To do that, you need to switch to the Text Editor by clicking on the Text tab. Next, you can add rel=”nofollow” to any link you want.

Add nofollow attribute to links in classic text editor

To go back to the visual editor, you have to click on the Visual tab, placed just beside the Text tab.

Some bloggers and site owners may add external links to the navigation menu of their website.

While adding a nofollow attribute to WordPress menu links is extremely simple, it is not as clearly visible.

Let’s take a look at how to add nofollow links in WordPress navigation menus.

First, you need to click on Appearance » Menus from the left sidebar of your admin panel.

Next, select the menu where you want to add the external link and then click on the Select button to open it.

Select a navigation menu to edit

After that, you need to click on the “Custom Links” tab to add the link text and external link URL. Once done, you need to click on the “Add to Menu” button to create a new menu item.

Add Custom Link to Navigation menu in WordPress

The external link will now appear in the Menu Structure column along with the other menu items.

Next, click on the Screen Options button at the top-right corner of the screen and select the Link Relationship (XFN) and Link Target options.

Screen Options navigation menus

Now scroll back down and click on the downward arrow icon of the new menu item to expand it. Here you will find the “Link Relationship” and “Open link in a new tab” options, just below the Navigation Label textbox.

Add nofollow to Link Relationship XFN option

To add the nofollow attribute, you need to write nofollow in the Link Relationship (XFN) textbox. You can also check the “Open link in a new tab” option if you want.

Click on the Save Menu button

Lastly, click on the Save Menu button to store your changes. This will add the nofollow attribute to the external link in your WordPress menu.

Some WordPress users want to automatically add the nofollow attribute to all external links on their site.

Most solutions that offer this are done with the help of JavaScript which is not helpful for Google and the SEO of your site. Instead, you should manually nofollow the links using the above methods.

In case you are concerned about the comment section, then the good news is that WordPress already adds the nofollow attribute to all comment links by default.

If you’re still looking for a solution to automatically nofollow the external links, then you can use the External Links plugin.

It adds the rel=”nofollow” attribute to all the external links on the posts, pages, navigation menus, and the sidebar.

To install the External Links plugin, head over to Plugins » Add New from the left sidebar of your admin panel.

Upon activation, you need to go to Settings » External Links page.

External Links plugin settings page

Here you need to select the “Add No Follow” checkbox. If you want the external links to open in a new tab, then you should select the “Open in New Windows” checkbox as well.

This plugin also allows you to add a list of domains and subdomains which should not be made nofollow.

To do that, you need to scroll down to the bottom of the page and then add the domains, separated by commas or space, to the “Domains to Exclude” textarea.

Domains to exclude nofollow attribute

Once done, you should click on the Save Changes button to store the settings.

That’s all! This plugin will now make all the external links nofollow on your site automatically.

We hope this guide helped you to learn how to add nofollow links to your WordPress site. You may also want to read our beginner’s guide to image SEO, and our ultimate guide for blog post SEO to help you further optimize your blog posts.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.



Source link

Beginners Guide: 26 Most Common WordPress Mistakes to Avoid


When creating a WordPress website, everyone make mistakes. However each mistake is a learning opportunity that helps you grow.

Over the years, we have helped thousands of WordPress users start their websites and blogs. In setting up our own websites as well as helping others, we have learned to avoid some common WordPress mistakes.

It has helped us save time, money, and grow our business more effectively.

In this article, we will share those experiences with you, so you can avoid these common WordPress mistakes.

The goal is to help you learn from other people’s mistakes when making your own websites.

Common WordPress mistakes to avoid

1. Choosing The Wrong Platform

Choosing the right WordPress

The biggest mistake people make when starting out is choosing the wrong blogging platform. Basically, there are two types of WordPress. First, there is WordPress.com which is a blog hosting service, and then there is WordPress.org also which is the famous self-hosted WordPress platform that everyone loves.

You need to start with self-hosted WordPress.org because it gives you access to all the features you need out of the box.

To learn more see our article on WordPress.com vs WordPress.org with a side by side comparison of the two platforms.

2. Buying More than What You Need

To get started with a WordPress website, you need a domain name and WordPress hosting.

The challenge is that a lot of domain registrars try to upsell other services. This confuses the small business owners who are just starting out.

The add-on services may include privacy protection, extra email accounts, security services, and more.

Upselling services

You can skip all of these things and save money to spend on growing your business. If you later decide that you need those services, then you can always purchase them from your hosting company.

You also need to choose the right hosting plan for your website. For 90% of websites that are just starting out, a shared hosting account is quite enough to get you going.

We recommend using Bluehost. They are one of the biggest hosting companies in the world and officially recommended by WordPress.

They are offering WPBeginner users a discount on hosting + free domain and SSL certificate. Basically, you can get started for $2.75 per month.

→ Click Here to Claim This Exclusive Bluehost Offer ←

As your business grows, you can choose to upgrade your hosting plan or move to a managed WordPress hosting company.

For more details, see our guide on the cost of a WordPress website and how to save money when building your website.

3. Not Setting up Automated Backups

Automated backups

Each year billions of dollars worth of damages are caused by data loss. Almost every website on the internet is prone to accidents, theft, hacking attempts, and other disasters.

Your most powerful line of defense against these threats is automated backups. Without a backup, you could lose all your WordPress data, and it would be very difficult to recover it (sometimes even impossible).

We have seen many people lose their entire websites just because they didn’t have an up to date backup.

Setting up backups is extremely easy, and there are excellent WordPress backup plugins available in the market. Once you set up one of these backup plugins, they would automatically create backups for you.

The second part of this mistake is not storing backup files on a remote location. A lot of folks store their WordPress backups on their web hosting server. If they lose their website data, then they also lose the backups.

Make sure that you store your backups on cloud storage service like Google Drive, Dropbox, etc. Backup plugins like UpdraftPlus can automatically do that for you.

4. Not Setting up Google Analytics

Google Analytics

If you want to grow your business with confidence, then you need to know how people find and use your website. That’s where Google Analytics can help.

We recommend using MonsterInsights, the most popular Google Analytics plugin for WordPress. It saves you time during setup, and shows you the stats that matter, right inside your WordPress dashboard.

If you don’t want MonsterInsights Pro, then there’s also a free version of MonsterInsights available that you can get started with.

5. Not Setting up a Contact Form

Contact page

Not setting up a contact form is another easily avoidable mistake that many beginners make. Without a contact form, your website visitors will not be able to contact you, and this can cause you to lose significant opportunities.

You will see a contact page on almost every popular website. It is one of the most important pages every website need to have.

WordPress does not come with a built-in contact form, but there are a lot of great WordPress contact form plugins available that you can use.

We recommend using WPForms Lite which is the free version of the popular WPForms plugin that’s being used by over 2 million websites.

You can see our detailed instructions on how to create a contact form in WordPress.

6. Not Building an Email List

Email list

Did you know that more than 70% of people who visit your website will never come back again?

If you are not building your email list, then you are basically losing money with every website visitor that leaves your site. Converting website visitors into email subscribers allows you to bring back those users to your website.

To learn more about this topic, see our article on why building an email list is important.

You will need an email marketing service to set up your email list. We recommend using Constant Contact because they are one of the best email marketing companies on the market with a very beginner friendly platform.

For step by step instructions, see our complete tutorial on how to start an email newsletter.

7. Not Choosing The Right WordPress Theme

WordPress themes

One of the biggest challenges WordPress beginners face is choosing the right design for their website.

With thousands of WordPress themes out there, an average beginner tries multiple themes before settling for the right one, and this process can even lead the user to rebuild their website multiple times.

To avoid this, we recommend choosing the right WordPress theme from the start and then stick to it.

This allows your website visitors to become familiar with your website, your brand, and its unique style. Consistency and continuity of your design makes a big impact on brand recognition and awareness.

We are often asked by readers, how to choose a theme that just works?

Well, when it comes to design we prefer simplicity over glitter. It has worked really well not just for us, but many successful online businesses.

You need to choose a great looking but simple WordPress theme that pays attention to the following items:

  • It must look equally good on all devices (desktop, mobile, and tablets).
  • It should be easy to customize and flexible to adapt to your needs.
  • It should work with popular plugins and WordPress page builders.
  • It should be optimized for performance and speed.

Now we understand that as a non-techy user, you may not be able to check all those things on your own. In that case, we recommend choosing a theme from a top commercial WordPress theme shop like StudioPress, Themify, or Astra Theme.

If you need more recommendations, then check out these theme showcases where we hand-picked the best WordPress themes in different categories.

  • Best WordPress blog themes
  • Best WordPress business themes
  • Best simple WordPress themes
  • Best multi-purpose WordPress themes

8. Ignoring WordPress Updates

Ignoring WordPress updates

We have seen many beginners and even experienced WordPress users who don’t install updates on their site. Many of them believe that doing so will cause errors and could break their site.

That’s not true.

You can easily and safely update WordPress without breaking your website. By not updating WordPress, you leave your website vulnerable to security breaches while using outdated software.

It’s not just WordPress, your WordPress theme and plugins also regularly release updates for bug fixes, security patches, and new features.

For more details, see our guide on how to safely update WordPress

9. Not Optimizing Your Website for SEO

Optimize WordPress SEO

A lot of WordPress users rely on their best guesses when it comes to promoting their websites. Some completely ignore SEO, while some do it half-heartedly.

SEO (Search Engine Optimization) helps you rank higher in search engines, so more users can find your website.

Search engines are the biggest source of traffic for most websites. SEO is crucial for the success of your online business.

We have a complete step by step WordPress SEO guide for beginners which will help you properly optimize your website for SEO.

10. Not Using Categories and Tags Properly

Categories vs Tags

Another big mistake is not using categories and tags properly. Some users end up using categories where they should have used tags and vice-versa.

We have seen websites with dozens of categories and no tags at all. We have seen websites using hundreds of tags and no categories at all.

Basically, categories are your website’s table of contents. If your website was a file cabinet, categories would be its drawers.

On the other hand, tags are like the index page. If your website was a file cabinet, tags would be the labels on individual file folders.

For a more detailed explanation, see our guide on categories vs tags and how to use them properly in WordPress for maximum SEO advantage.

11. Not Using Posts and Pages Properly

Posts vs Pages - What's the difference?

Sometimes beginner WordPress users end up using posts to create important website pages. Similarly, some users end up using pages for articles when they should have used posts instead.

A lot of users realize their mistake after a while when their website becomes difficult to manage.

Basically, pages are for static pages that don’t change very often like about, contact, privacy policy, etc.

On the other hand, posts are for time-based content like news, updates, articles, and blogs.

Take a look at our complete guide about the difference between posts vs pages and what you can do with them.

12. Not Choosing The Right URL Structure (Permalinks)

Choosing the right permalinks structure

Selecting the right URL settings (permalink structure) for your website is really important. Changing your URL structure later is not easy, and it can have a significant impact on your website traffic.

We recommend going to the Settings » Permalinks page in your WordPress admin area and choosing a URL structure with that shows your post name in the URL.

13. Ignoring Website Speed and Performance

Website speed and performance

Human attention span is dropping rapidly, and users want instant gratification. With faster internet connections, your users would find a few extra seconds of page load time to be extremely slow.

And it’s not just users, even search engines rank faster websites higher in their results. By ignoring website speed and performance you risk user experience as well as search rankings.

Which is why you need to make sure that your website loads fast. We have a step by step guide that will help you improve WordPress speed and performance without going too deep into the technical stuff.

14. Not Choosing The Right Plugins

WordPress plugins

The real power of WordPress comes with its plugins. There are thousands of free WordPress plugins that you can install with a few clicks.

However, not all plugins are good. In fact, some plugins are bad and could affect your website’s performance and security. Often users end up downloading plugins from unreliable sources that distribute hidden malware.

Here are a few things you need to keep in mind when choosing plugins:

  • Only install plugins from WordPress.org or WordPress companies with good reputation.
  • Look for plugin reviews and support forums because they are a good indicator of a plugin’s quality
  • Check trusted WordPress resources like WPBeginner for plugin recommendations

If you want some recommendations right now, then check out our list of must have WordPress plugins for all websites.

For more information, check out our guide on how to choose the best WordPress plugins for your website.

15. Ignoring WordPress Security Best Practices

WordPress security

Many users do not take any security measures to harden WordPress security. Some believe that their website is too small, and it will not be targeted by hackers.

Hackers target websites indiscriminately. For example, they could use your website to distribute malware, brute force attacks, steal data, and more.

By not securing your website, you can lose search rankings, your website data, and/or customer information. This could cost you a lot of money and headache.

You need to follow the security best practices and build layers of security around your WordPress site. It does not take too much time, and you don’t need any special skills to do that.

Simply follow our complete WordPress security guide with step by step instructions to protect your website.

16. Changing Website URL and Losing All Traffic

Changing domain names

How many of you hated the first domain you registered and wanted to switch away from it when you got serious about blogging? Yup, it happens to all of us.

While you can change the website URL or domain name, it does have a significant SEO impact. What makes matters even worse is when you switch URLs without taking proper steps.

You need to set up proper redirects, inform Google about the change, and add the new domain to Google Search Console.

We have described all the steps in our guide on how to properly move WordPress to new domain.

17. Not Removing WordPress Demo Content

Remove demo content

A lot of people don’t delete the default demo content added by a new WordPress install. This includes a sample page, a post titled ‘Hello World’, and a default comment.

Not removing this content allows search engines to crawl and index them. Now if you search for the text in demo content on Google, you’ll find hundreds of thousands of pages. That’s duplicate content and search engines penalize duplicate content as low-quality pages.

Similarly, many people don’t change the default WordPress tag line that says ‘Just another WordPress site’.

You need to delete all default content and the tag line, as they look unprofessional and create a bad impression.

18. Not Setting up Comment Moderation

Moderating comments

Comment spam is annoying and can make your brand look bad. Many beginners have their blogs set up to automatically publish all new comments without moderation.

This means spam comments with links to malware and low-quality sites can go live on your website without your knowledge. This could damage your search rankings and your website’s reputation.

You need to always keep comment moderation turned on for all your WordPress sites. Simply go to Settings » Discussion page and check the box next to ‘A comment must be manually approved’ option.

Manually approve comments

After that, you need to make it part of your routine to check and approve comments on your website. For more tips, see our article on how to combat comment spam in WordPress.

19. Not Optimizing Your Images for Web

Compress images

Images are essential in the making of a highly engaging website. However, they are also heavier in filesize than plain text.

If you are adding images to your website without optimizing them, then this would affect your website speed.

You need to make it a habit of saving your images as optimized for the web. You can use Photoshop, GIMP (free), or other online tools to reduce the image file size before uploading it.

For instructions, see our tutorial on how to save images optimized for the web.

20. Saving Unnecessary Code in Theme’s Functions File

Code snippets

Another common mistake that we often come across is when folks add too many code snippets in their theme’s functions.php file.

Functions file is designed to behave like a plugin, but it is not the ideal place for all types of code snippets. You will lose these modifications when you switch the theme. You may even forget that you added some code in there after a while.

We recommend only adding code in your theme’s functions file if the code is related to changing something with that particular theme.

For all other custom code, it is better to use a site-specific plugin or the code snippets plugin.

21. Getting Locked Out by Editing Functions File in WordPress Admin Area

Theme editor in WordPress

Another annoying mistake that is quite common is when folks edit functions file inside the WordPress admin area.

By default, WordPress comes with a built-in code editor to edit theme and plugin files inside WordPress. Often beginners end up breaking their website when adding or removing code using those editors.

Even though WordPress added functionality to catch fatal errors and not save them. You could still lock yourself out and make your website inaccessible.

We recommend disabling theme and plugin editor in WordPress and use FTP to edit files in WordPress.

22. Not Setting Up Google Search Console

Google Search Console

Data is really important when planning a strategy to grow your business and website. Many users make the mistake of not adding their WordPress site to Google Search Console for a long time.

This means they miss out important search data that could help them grow their website.

Google Search Console is a free tool provided by Google. It allows you to see how your website appears in search results and fix any search indexing problems quickly.

See our complete Google Search Console guide to see how you can use it to improve search rankings and grow your business.

23. Using Uncategorized as Default Category

Uncategorized category

A lot of folks leave Uncategorized as their default category. WordPress requires all posts to be filed under a category and when no category is selected, it automatically adds the post under default category.

Many times users forget to select a category for their post and hit the publish button which publishes that post in Uncategorized.

This mistakes can be easily avoided by choosing a proper default category in WordPress settings.

24. Not Using a Professional Branded Email Address

Free business email address

We have seen many folks sending us emails from their Gmail or Hotmail accounts while pitching for a business that already has a website.

Now, how do we know for sure that they are officially representing that company or website?

Similarly if you have a business, and you are still sending people business emails from a free email account, then people will have a hard time taking you seriously.

People do not have the time or skills to verify that you are the actual owner of that website or business.

This mistake is also easily avoidable. See our guide on how to easily get a professional business email address for free.

25. Leaving a Site Public While Working on It

Maintenance mode

People often leave under construction websites publicly accessible. This is not very professional and can harm your business.

A publicly accessible website can be automatically crawled and indexed by search engines anytime. Your competitors can find it and steal your ideas. Your customers can find it and see the unfinished website.

There is an easier solution to avoid this mistake. Simply put your website in maintenance mode and add a coming soon page to build anticipation.

26. Not Learning WordPress

Learn WordPress

WordPress is very easy to use even for non-technical users. This allows many users to keep running their websites without learning more about WordPress.

By doing so, you miss the opportunity to explore the incredibly helpful features of WordPress. Things that are very simple to implement but could transform your business.

Learning WordPress is quite easy, particularly when you already have a running WordPress site. Explore different sections of WordPress, try out new plugins, learn more about SEO, and email marketing.

WPBeginner is the largest free WordPress resource site for beginners with tons of awesome resources, videos, how-tos, step-by-step tutorials, and more.

Following are just some of the helpful resources you’ll find on WPBeginner (all of them are completely free).

  • WPBeginner Dictionary – The best place for beginners to start and familiarize themselves with the WordPress lingo
  • WPBeginner Videos – New to WordPress? Watch these 23 videos to master WordPress.
  • WPBeginner Blog – The central place for all our WordPress tutorials.

You can also subscribe to our YouTube Channel where we regularly share video tutorials to help you learn WordPress.

We hope this article helped you learn about common WordPress mistakes and how to easily avoid them. You may also want to see our tips on effective ways to increase your website traffic without spending too much money.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post Beginners Guide: 26 Most Common WordPress Mistakes to Avoid appeared first on WPBeginner.



Source link

How to Easily Deactivate WordPress Plugins (Beginner’s Guide)


Do you want to learn how to deactivate WordPress plugins? One of the best things about WordPress plugins is that you can turn them off temporarily by deactivating them. You can also completely remove WordPress plugins by uninstalling them.

As a WordPress beginner, you need to know how to deactivate one or all of your WordPress plugins. Learning this will help you with troubleshooting and fixing common WordPress errors.

In this article, we will show you different ways to easily deactivate WordPress plugins. Our goal is to help you learn how to better manage WordPress plugins on your website.

How to easily deactivate WordPress plugins

Here is an overview of what you’ll learn in this article:

  • How to deactivate a WordPress plugin
  • How to bulk deactivate WordPress plugins
  • How to deactivate all WordPress plugins via FTP
  • How to deactivate WordPress plugins via phpMyAdmin
  • Difference between deactivating vs uninstalling a plugin
  • How to uninstall a WordPress plugin
  • Should you keep deactivated plugins installed on your site?

How to Deactivate a WordPress Plugin

Let’s start with deactivating a single WordPress plugin.

If you want to temporarily disable or deactivate a WordPress plugin, then you need to simply visit the Plugins » Installed Plugins page inside your WordPress admin area.

Deactivate a WordPress plugin

From here, you need to locate the WordPress plugin that you want to deactivate. Next, take your mouse to the plugin’s row, and it will show you a link to deactivate that particular plugin.

Clicking on the link will simply deactivate the WordPress plugin right away.

Once you deactivate the plugin, it still remains installed on your website, but WordPress will stop loading it.

If you want to start using the plugin again, then you will just need to click on the Activate link below it.

How to Bulk Deactivate WordPress Plugins

Sometimes you may need to deactivate all WordPress plugins on your website to troubleshoot issues. Instead of deactivating one plugin at a time, WordPress makes it easy to deactivate multiple or all WordPress plugins quickly.

Simply visit the Plugins » Installed Plugins page and check the box next to the plugins you want to deactivate. If you want to deactivate all WordPress plugins, then simply check the box at the top to select all plugins.

Select all plugins

Next, you need to select ‘Deactivate’ from the ‘Bulk Actions’ drop-down menu and click the ‘Apply’ button.

Bulk deactivate all WordPress plugins

WordPress will now deactivate all selected WordPress plugins.

How to Deactivate All WordPress Plugins via FTP

If you have been locked out of your WordPress admin area, then you will not be able to deactivate WordPress plugins from your dashboard.

In such situations, you will need to deactivate plugins using other methods. The easiest of them is to deactivate WordPress plugins via FTP or your WordPress hosting file manager.

Basically, WordPress looks for your installed plugins in the /wp-contents/plugins/ folder. If it cannot find the plugin’s folder, then WordPress will automatically deactivate all plugins.

Instead of deleting the plugin’s folder, we will just rename it.

First, you will need to connect to your WordPress site using an FTP client. Once connected, you need to navigate to the wp-content folder inside your WordPress root directory.

Rename plugins folder to deactivate all plugins

From here, you need to right-click on the plugins folder and then select ‘Rename’. This will bring up a popup where you need to enter a new name for your plugin’s folder such as plugins-deactivated.

Plugins deactivated

Your FTP client will now rename the plugin’s folder. You can now try to login to your WordPress admin area and visit the plugin’s page. You will see notifications about deactivated WordPress plugins.

Deactivated WordPress plugins

How to Manually Deactivate WordPress Plugins via PHPMyAdmin

The FTP method is definitely easier in our opinion. However, you can also deactivate all plugins using phpMyAdmin.

First, you will need to login to your web hosting account’s dashboard. Next, click on the phpMyAdmin icon under the ‘Databases’ section.

phpMyAdmin icon in cPanel

This will bring you to the phpMyAdmin interface. First, you will need to select your WordPress database from the left menu.

WordPress options table

PhpMyAdmin will now load your database tables in the right panel. You need to click on the ‘Browse’ button next to the wp_options table (your WordPress table name may differ depending on your WordPress database table prefix).

Now, phpMyAdmin will load data inside the options table. You need to scroll down to the row where option_name is ‘active_plugins’ and click on the ‘Edit’ button next to it.

Active plugins row in the WordPress database

PhpMyAdmin will open the row for editing, You need to delete the data inside the option_value field.

After that, click on the ‘Go’ button at the bottom to save your changes.

You can now visit your website and WordPress will see that all plugins have been deactivated.

What is The Difference Between Deactivating vs Uninstalling a WordPress Plugin?

The difference between deactivating vs uninstalling a WordPress plugin is quite simple.

When you deactivate a WordPress plugin, it is simply turned off. However, it is still installed on your website, so you can activate it again if you need to.

On the other hand, uninstalling a plugin completely deletes it from your website. You will not be able to see the plugin on the Plugins » Installed Plugins page.

If you want to reuse that same plugin, then you will have to install it again.

How to Uninstall a WordPress Plugin

WordPress makes it super easy to uninstall plugins from the admin area. Simply log in to your WordPress dashboard and go to the Plugins page.

You will see the list of currently installed plugins on your site. Your active plugins will be highlighted with a blue background.

If you want to uninstall an active plugin, then first you will need to deactivate it. After that, Click on the delete link below the plugin that you want to uninstall.

Delete WordPress plugin

WordPress will now ask you to confirm that you want to delete the plugin.

Confirm plugin deletion

You need to click on ‘Yes, delete these files’ button. WordPress will now safely remove the plugin from your web server.

That’s all you have successfully uninstalled a plugin from your WordPress site.

Some WordPress plugins leave traces of data and files even when they are uninstalled.

These items don’t have any significant impact on your WordPress site, but if you want to remove them, then here is how you would do it.

Removing unused shortcodes

Many WordPress plugins use shortcodes to easily add content to your posts or pages. Once you deactivate or uninstall a plugin, those shortcodes will become visible in your posts, and they look quite ugly.

[pluginshortcode]

You can easily disable shortcodes by adding the following code to your theme’s functions.php file or a site-specific plugin.

add_shortcode( 'pluginshortcode', '__return_false' );

This code basically adds the shortcode back and make it display nothing. Don’t forget to replace pluginshortcode with the shortcode tag used by the plugin you want to remove.

It is important to note, that you will need to remove this code if you ever decide to use that plugin again.

Cleaning up plugin traces from WordPress database

Some WordPress plugins create their own tables in the WordPress database. If these tables have too much data in them, then that would increase your WordPress backup size.

To clean these up, you need to launch the phpMyAdmin from your WordPress hosting dashboard.

phpMyAdmin icon in cPanel

You need to click on your database and then select the tables you want to delete. Below the tables list, you will see a drop-down labeled ‘With selected’. You need to click on the drop-down, and then select ‘Drop’.

Delete plugin tables

Next, you will see a warning that you are about to delete these tables. You need to click on Yes to confirm the action. Please note that it is irreversible, once deleted you will not be able to restore these tables unless you have a database backup.

Delete warning

PhpMyAdmin will now delete the database tables from your unused plugins.

Clean up unused WordPress plugin files

Often WordPress plugins create files and folders on your hosting server. These files are usually harmless, but can increase your WordPress backup size.

To delete them, you need to connect to your WordPress site using an FTP client. Once connected, you need to go to wp-content folder. You will find files and folders created by plugins inside the uploads and plugins folders.

Make sure that the files you are deleting are created by the plugin that you have uninstalled. After that, simply delete them from your web server.

Delete plugin files

Should You Keep Deactivated WordPress Plugins Installed on Your Site?

If you are not going to use those plugins, then you should not keep inactive or deactivated WordPress plugins installed on your website.

Inactive plugins don’t have any performance impact on your website. However, plugins contain executable files and can be used by hackers to hide malware or a backdoor.

Apart from security concern, they also increase your WordPress backup size, show up as false positive in security scans, and cause other issues.

This is why we always recommend users to delete inactive plugins from their site.

We hope this article helped you learn how to properly deactivate WordPress plugins. You may also want to see our article on how to choose the best WordPress plugin for your website, and our list of must have WordPress plugins.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Easily Deactivate WordPress Plugins (Beginner’s Guide) appeared first on WPBeginner.



Source link

Beginner’s Guide to WordPress Template Hierarchy (Cheat Sheet)


After our infographic on how WordPress works behind the scenes, several users asked us to cover how a WordPress theme works behind the scenes.

In this article, we will explain the WordPress template hierarchy for beginners. This cheat sheet is extremely useful when customizing a template or creating a custom WordPress theme.

WordPress template hierarchy explained for beginners

Why Learn About WordPress Template Hierarchy?

All modern WordPress themes consist of templates, stylesheets, javascript, and images. Together these files control how your site looks to the users.

Related: 9 things you must look for when selecting the perfect WordPress theme for your site.

WordPress has a standard template hierarchy. This means that templates with certain filenames affect specific areas on your website. It also tells you what template name to use for a specific item.

Most modern WordPress themes come with templates to display category, date, archives, single posts, custom pages, and more. As a user, you can create more templates by creating a child theme.

Having said that, let’s take a look at how this WordPress template hierarchy works behind the scenes.

Visualizing WordPress Template Hierarchy (Cheat Sheet)

WordPress uses an easy to understand and meaningful pattern for template names. The visual cheat sheet below explains which template files are used to display different pages on a WordPress site.

Here is a breakdown of which WordPress template files to edit for different pages in a typical WordPress site.

Which template files are used by home page?

Site front page

Out of the box, WordPress displays your blog posts on the home page of your website. You can also set it to use a custom home page (also known as front page) by visiting Settings » Reading page in WordPress admin area.

1. front-page.php – If you are using a static front page, then WordPress will first look for this template file and use it to display front page.

2. home.php – If you are using static front page, and you don’t have front-page.php template in your theme, then WordPress will look for home.php template. It is also used to display default blog posts on homepage.

3. index.php – If front-page.php or home.php do not exist, then WordPress falls back to index.php template to display homepage. This template is the default fallback template in WordPress to display any page.

Which template files are used by single post?

Single post page template

WordPress looks for these files to display a single post.

1. single-post-type-slug.php – Use this template to modify the display of a specific individual post in any post type. For example, if post type is ‘review’ and the post slug is acme-phone, then WordPress would look for single-review-acme-phone.php.

2. single-post-type.php – WordPress will then check if there is a template to display this specific post type. For example, if the post type is review, then WordPress would look for single-review.php.

3. single.php – WordPress will then fall back to single.php.

4. singular.php – This template adds another fallback to display a single item from any post type.

5. index.php – Finally, as mentioned above, WordPress ultimately falls back to index.php.

Which template files are used by single page?

Static page template

WordPress pages are one of the default post types. They allow you to create static pages in your website instead of posts. See our guide on the difference between posts vs pages.

1. Custom Page Template – The page template assigned to the page. See how to create a custom page template in WordPress.

2. page-slug.php – If the page slug is contact-us, WordPress will look to use page-contact-us.php.

3. page-id.php – If the page ID is 17, then WordPress will look for a template file named page-17.php.

4. page.php – The template to display all static pages.

5. singular.php – This template is a default fallback to all single post type items.

6. index.php – The default fallback template.

Which template files are used by category archives?

Category archive template

WordPress uses these files to display category related pages in WordPress.

1. category-slug.php – This template is used to display category archive page for a specific category. For example, if category slug is reviews, then WordPress will look for category-reviews.php template.

2. category-id.php – WordPress then looks for a template with category ID. For example, if category ID is 17, then WordPress will look for category-17.php.

3. category.php – This is the default template to display all category archive pages in WordPress.

4. archive.php – This is the default template used by WordPress to display any archive pages.

5. index.php – The default fallback template.

Which template files are used by tag archives?

Tag archive template

WordPress uses these files to display tag archive pages.

1. tag-slug.php – If the tag’s slug is fruits, WordPress will look for tag-fruits.php.

2. tag-id.php – If the tag’s ID is 17, WordPress will look for tag-17.php template.

3. tag.php – The default template for tag archives.

4. archive.php – The default template for any achive page.

5. index.php – The default fallback template.

Which template files are used by custom taxonomy archives?

Custom taxonomy archive

Categories and tags are two default WordPress taxonomies. Users can also create their own custom taxonomies as well. Here is how WordPress looks for templates to display custom taxonomy pages.

1. taxonomy-taxonomy-term.php – If you have a custom taxonomy called genre, and there is a term ‘thriller’, then WordPress will look for taxonomy-genre-thriller.php.

2. taxonomy-taxonomy.php – If the taxonomy were genre, WordPress would look for taxonomy-genre.php.

3. taxonomy.php – The default template to display any custom taxonomy archives.

4. archive.php – The default fallback for all archive pages in WordPress.

5. index.php– The default fallback template in WordPress.

Which template files are used by custom post types?

Custom post type archive

Here is how WordPress looks for templates to display custom post type archives.

1. archive-post_type.php – If you have a post type is review, WordPress will look for archive-review.php.

2. archive.php – The default template to display all archive pages in WordPress.

3. index.php – The default fallback template in WordPress.

Which template files are used to display author archives?

Author archive

WordPress generates archive pages for each author on your WordPress site. Here is how it looks for author archive template.

1. author-nicename.php – If the author’s nice name is matt, WordPress will look for author-matt.php.

2. author-id.php – If the author’s user ID is 6, then WordPress will look for author-6.php.

3. author.php – The default template used to display author archive pages in WordPress.

4. archive.php – The default template to display all archive pages in WordPress.

5. index.php – The default fallback template in WordPress.

Which template files are used to display date based archives?

Date based archive

WordPress also displays your posts on date based archive pages for months and years. Here is how it looks for templates for these pages.

1. date.php – The default template for date based archives.

2. archive.php – The default template used to display author archive pages in WordPress.

3. index.php – The default fallback template in WordPress.

Which template files are used to display search pages?

Search result page

1. search.php – The default page to display search results in WordPress.

2. searchform.php – The template to display a search form in WordPress.

3. index.php – The default fallback template in WordPress.

Which template files are used to display 404 error pages?

404 Error page

The 404 error page is displayed when WordPress is unable to find the requested content. See our guide on how to improve your 404 page template.

1. 404.php – The default template to display 404 error page in WordPress.

2. index.php – The default fallback template in WordPress.

Which template files are used to display attachment pages?

Attachment pages

1. MIME_type.php – Mime_type stands for file type. For example, image.php, video.php, application.php.

2. attachment.php – The default template to display attachment pages.

3. single-attachment.php – To display a single attachment.

4. single.php – The default template to display single post type items.

5. index.php – The default fallback template in WordPress.

Which template files are used to display embeds?

Embeds

Since WordPress 4.5, you can use templates to render a post embedded into WordPress.

1. embed-post-type-post_format.php – WordPress will look for a post type and post format template first. For example, if you have a review with video, then WordPress will look for embed-review-video.php.

2. embed-post-type.php – If the post type is review, WordPress would look for embed-review.php.

3. embed.php – The default fallback for all embeds.

We hope this tutorial helped you learn about the WordPress template hierarchy. You may also want to see our list of the best drag & drop WordPress page builders.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post Beginner’s Guide to WordPress Template Hierarchy (Cheat Sheet) appeared first on WPBeginner.



Source link

Beginner’s Guide to Image SEO – Optimize Images for Search Engines


Are you looking to improve image SEO on your website? When optimized properly, image search can bring many new visitors to your website.

To benefit from image SEO, you need to help search engines find your images and index them for the right keywords.

In this beginner’s guide, we will show you how to optimize image SEO by following top best practices.

Image SEO guide for beginners

Here is a brief overview of what you’ll learn in this article.

  • Optimizing your images for SEO and Speed
  • What is Alt text?
  • Difference between Alt text vs title
  • Difference between alt text and caption
  • How to add alt text, title, and caption to images in WordPress
  • When to use captions for images
  • Disable attachment pages in WordPress
  • Additional tips to improve image SEO

Optimizing Your Images for SEO and Speed

Speed plays an important role in SEO and user experience. Search engines consistently rank fast websites higher. This is also true for the image search.

Images increase your overall page load time. They take longer to download than text, which means your page loads slower if there are several large image files to download.

You need to make sure that images on your site are optimized for web. This can be a little tricky to get used to since many beginners are not experts in graphics and image editing.

We have a handy guide on how to properly optimize images before uploading them to your website.

The best way to optimize images is by editing them on your computer using a photo editing software like Adobe Photoshop. This allows you to choose the right file format to create a small file size.

You can also use an image compression plugin for WordPress. These image optimizer plugins allow you to automatically reduce file size while uploading an image to WordPress.

What is Alt Text?

Alt text or alternative text is an HTML attribute added to the img tag which is used to display images on a web page. It looks like this in plain HTML code:

<img src="http://www.wpbeginner.com/fruitbasket.jpeg" alt="A fruit basket" />

It allows website owners to describe the image in plain text. The main purpose of the alternate text is to improve accessibility by enabling screen readers to read out the alt text for visually impaired users.

Alt text is also crucial for image SEO. It helps search engines understand the context of the image.

Modern search engines can recognize an image and it’s content by using artificial intelligence. However, they still rely on website owners to describe the image in their own words.

Alt text also accompanies images in Google image search, which helps users understand the image and improves your chances of getting more visitors.

Alt text used in search results

Usually, alt text is not visible on your website. However if an image is broken or cannot be found, then your users will be able to see the alternate text with a broken image icon next to it.

Alternate text displayed next to a broken image

What is the Difference Between Alt Text vs Title

Alt text is used for accessibility and image SEO, while title field is used internally by WordPress for media search.

Search image by title

WordPress inserts the alt tag in the actual code used to display the image. The title tag is stored in the database to find and display images.

In the past, WordPress inserted the title tag in the HTML code as well. However, it was not an ideal situation from the accessibility point of view, which is why they removed it.

What is the Difference Between Alt Text vs Caption

The alt text is used to describe the image for search engines and screen readers. On the other hand, the caption is used to describe the image for all users.

Alt text is not visible on your website while captions are visible below your images.

Example of a caption displayed below an image

The alt text is crucial for better image SEO on your website. The caption is optional and can be used only when you need to provide additional information about the image to website visitors.

How to Add Alt Text, Title, and Caption to Images in WordPress

Alt text, title, and caption make up the image metadata that you can add to images when uploading them into WordPress.

When you add an image using the default image block, WordPress allows you to add caption and alt text for the image.

Adding alt text and caption to an image in WordPress

It automatically generates a title for the image from the file name. You can change the title by clicking on the edit button in the image block’s toolbar.

Editing an image in default WordPress editor

This will bring up the media uploader popup where you can enter your own custom title for the image.

Changing image title in WordPress

You can also edit the alt tag and title for the images that you have already uploaded to WordPress. To do that, you need to visit Media » Library page and locate the image you want to edit.

WordPress media library

Simply clicking on an image will bring up the attachment details popup where you can enter title, alt text, and caption.

Add alt tag and title via media library

Note: Changing an image’s alt tag or caption via Media Library will not change it in the posts and pages where the image is already used.

When to Use Captions for Images in WordPress

Captions allow you to provide additional details for an image to all your users. They are visible on the screen for all users including search engines and screen readers.

An image gallery with captions for each image

As you may have noticed that most websites don’t normally use captions with images in their blog posts or pages. That’s because captions are often not needed to explain an image.

Captions are more suitable in the following scenarios:

  • Family or event photos
  • Photos that need additional explanation describing the background story
  • Product image galleries

In most cases, you would be able to explain the image in the article content itself.

Disable Attachment Pages in WordPress

WordPress creates a page for all images you upload to your posts and pages. It is called the attachment page. This page just shows a larger version of the actual image and nothing else.

This can have a negative SEO impact on your search rankings. Search engines consider pages with little to no text as low quality or ‘thin content’.

This is why we recommend users to disable the attachment pages on your website.

The easiest way to do this is by installing and activating the Yoast SEO plugin. For more details, see our step by step guide on how to install a WordPress plugin.

Upon activation, it automatically turns off attachment URLs. You can also manually turn off attachment pages in WordPress by visiting SEO » Search Appearance page and clicking on the Media tab.

Disable attachment URLs in WordPress

From here, make sure that the ‘Media & attachment URLs’ option is set to ‘Yes’.

If you are not using Yoast SEO plugin, then you can install the Attachment Pages Redirect plugin. This plugin simply redirects people visiting the attachment page to the post where the image is displayed.

You can also do this manually, by adding the following code to your theme’s functions.php file or a site-specific plugin.

function wpb_redirect_attachment_to_post()  
if ( is_attachment() )  
global $post;
if( empty( $post ) ) $post = get_queried_object();	
if ($post->post_parent)	
	$link = get_permalink( $post->post_parent );
	wp_redirect( $link, '301' );
	exit(); 
	
else	
	// What to do if parent post is not available
	wp_redirect( home_url(), '301' );
	exit(); 
	


add_action( 'template_redirect', 'wpb_redirect_attachment_to_post' );

Additional Tips to Improve Image SEO

Adding alt tag is not the only thing you can do to improve image SEO. Following are a few additional tips that you should keep in mind when adding images to your blog posts.

1. Write descriptive alt text

Many beginners often just use one or two words as alt text for the image. This makes the image too generic and harder to rank.

For example, instead of just ‘kittens’ use ‘Kittens playing with a yellow rubber duck’.

2. Use descriptive file names for your images

Instead of saving your images as DSC00434.jpeg, you need to name them properly. Think of the keywords that users will type in the search to find that particular image.

Be more specific and descriptive in your image file names. For example, red-wooden-house.jpeg is better than just house.jpeg.

3. Provide context to your images

Search engines are getting smarter every day. They can recognize and categorize images quite well. However, they need you to provide context to the image.

Your images need to be relevant to the overall topic of the post or page. It is also helpful to place the image near the most relevant text in your article.

4. Follow the SEO best practices

You also need to follow the overall SEO guidelines for your website. This improves your overall search rankings including image search.

5. Use original photographs and images

There are many free stock photography websites that you can use to find free images for your blog posts. However, the problem with stock photos is that they are used by thousands of websites.

Try to use original photographs or create quality images that are unique to your blog.

We know that most bloggers are not photographers or graphic designers. Luckily, there are some great online tools that you can use to create graphics for your websites.

We hope this article helped you learn about Image SEO for your website. You may also want to see our guide on how to fix common image issues in WordPress.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post Beginner’s Guide to Image SEO – Optimize Images for Search Engines appeared first on WPBeginner.



Source link

How to Install Google Analytics in WordPress for Beginners


Do you want to install Google Analytics in WordPress? Knowing how your audience interacts with your website is crucial for your success.

The best way to know your audience is through your traffic stats, and this is what Google Analytics provides for FREE.

In this article, we will share why Google Analytics is important, and how you can easily install Google Analytics in your WordPress website (step by step).

How to Install Google Analytics in WordPress

First, we will explain why Google Analytics is important and how it can help you grow your website.

After that, we will show you how to sign up for a Google Analytics account and different methods to install it on your WordPress site.

Finally, we will explain how to view your traffic reports in Google Analytics.

Here is a quick overview of what you’ll learn in this article.

  • Why is Google Analytics Important
  • How to Sign up with Google Analytics
  • How to Install Google Analytics Using MonsterInsights (Recommended)
  • How to Install Google Analytics Using Insert Headers & Footers Plugin
  • How to Install Google Analytics in WordPress Theme (Advanced)
  • Viewing Reports in Google Analytics
  • Making the Most out of Google Analytics
    • Ready let’s get started.

      Why is Google Analytics Important for Bloggers?

      Once you start a blog, your #1 goal is to get more traffic and subscribers. Google Analytics help you make data-driven decisions by showing you the stats that matter. You can see:

      Who visits your website?

      This part of analytics answers what is the geographical location of your audience, which browser did the user use to visit your site and other important information such as screen resolution, JavaScript support, Flash support, language and more.

      This data is extremely useful, and it can help in numerous ways. When getting a custom design, you can use the user data to make sure that your site will be compatible with your audience.

      If most of your users don’t have Flash support, then you should avoid adding the flash element in your site. If most of your users are on 1280 screen resolutions, then make sure that your design is compatible with that resolution or smaller.

      What do people do when they are on your website?

      You can track where the users are going on your website, how long do they stay on your website, and what is the bounce rate (the percent of users exit your site on the first visit).

      By using this information, you can decrease the bounce rate and increase your pageviews.

      You can also find your most popular articles, articles that are not doing so well, and what kind of content your users are looking for.

      When do people visit your website?

      By looking at the hottest hours in the day for your site, you can pick the time when you publish your post. If that time zone is not compatible with yours, then you can schedule your post to meet that hour.

      How do people find your website?

      This section of the analytics shows you where did the users come from (for example: Search Engines, Direct Links, Referral links from another site).

      It also shows you what percentage of your visitors came from each of these sources. Google analytics gives you the breakdown of each of these categories. If it is the search engine category, then it shows you which search engine got you the most traffic, Google, Yahoo, Bing etc.

      The breakdown of referral sources shows you which sites you need to work with the most. If your top referral source is Facebook, then you need to have exclusive Facebook content to make your Facebook audience feel special.

      If your top referral source is an external website, then you might want to consider having a partnership with that website (guest post exchange or something else).

      How do people interact with your content?

      Google analytics shows how your users interact with your site’s content. It shows you what percent of the user clicked on which link on your site and much more.

      You can run A/B split tests by creating content experiments in Google Analytics to understand what works best to meet your goals.

      By seeing the user interactivity, you can work your content around your users. By seeing the answers to the questions above, you can focus on the strategies that work for your site and avoid strategies that don’t work.

      Simply put, eliminate the guesswork and focus on stats that matter, so you can make data driven-decisions.

      How to Signup with Google Analytics

      Google Analytics is available for free and all you need is a Google or Gmail account to sign up. The sign up process is quite simple, follow the step by step instructions below to create your Google Analytics account.

      Step 1: First you need to visit Google Analytics sign up.

      You will be asked to login with your Google account. If you already have a Google or Gmail account, then you can use that to sign-in. Otherwise, you can go ahead and create a Google account for yourself.

      Sign in with your Google account

      Step 2: Once you sign-in with your Gmail account, you will be prompted to a screen like the one below. This is where you will signup for Google analytics with your Gmail account.

      Sign up for Google Analytics

      Step 3: On the next screen, you will be given choice to choose between a website or mobile app. Make sure you select website.

      After that, you need to enter account name (It will be the Google Analytics profile name for this website), Website name, website’s URL, country, and the time zone.

      Fill in your website information

      Once you have entered this information, click on the Get Tracking ID button. You will be presented with Google Analytics terms and service which you must agree to, so click on ‘I Agree’ button.

      Step 4: Now you will be presented with your Google Analytics tracking code. You can copy this tracking code because you will need to enter it in your WordPress site depending on the method you use below.

      Your Google Analytics tracking code

      We suggest leaving the analytics browser tab open as you may need to revisit it, once you have installed the code on your WordPress site.

      Now that you have setup a Google Analytics account, lets take a look at how to install Google Analytics in WordPress.

      How to Install Google Analytics in WordPress

      There are a few different ways to setup Google Analytics in WordPress. We will show you three methods where the first option is the easiest and the last being the hardest.

      You can choose the one that best suits your needs.

      1. Google Analytics for WordPress by MonsterInsights

      MonsterInsights is the most popular Google Analytics plugin for WordPress. Over 1 million websites use it including the likes of Bloomberg, PlayStation, Zillow, and more.

      It is the easiest and by far the best way to add Google Analytics to WordPress (for all users beginners and experts alike).

      MonsterInsights is available as both, a paid premium plugin, and a free version. In this tutorial, we will be using the MonsterInsights free version.

      You can use the MonsterInsights Pro version if you want more advanced features like E-commerce tracking, Ads tracking, Author tracking, etc. The process of setting them up is the same.

      Let’s get started.

      The first thing you need to do is install and activate the MonsterInsights plugin. For more details, see our step by step guide on how to install a WordPress plugin.

      Upon activation, the plugin will add a new menu item labeled ‘Insights’ to your WordPress admin menu. Clicking on it will bring the MonsterInsights setup wizard.

      MonsterInsights setup wizard

      First, you will be asked to choose a category for your website (a business website, blog, or online store). Select one and then click on ‘Save and Continue’ button.

      Next, you need to click on the ‘Connect MonsterInsights’ button.

      Connect MonsterInsights

      This will bring up a popup which will take you Google accounts where you will be asked to sign in or select a Google account if you are already signed in.

      Sign in or select a Google account to continue

      Next, you will be asked to allow MonsterInsights to access your Google Analytics account.

      Allow MonsterInsights to access your Google Analytics account

      Click on the ‘Allow’ button to continue.

      The final step is to select the profile you want to track. You need to select your website here and then click on the ‘Complete authentication’ button to continue.

      Select your website profile to compete setup

      MonsterInsights will now install Google Analytics on your website. After that you will be asked to select the recommended settings for your website.

      Recommended settings for Google Analytics

      The default settings would work for most websites. If you use an affiliate link plugin, then you need to add the path you use to cloak affiliate links. This will allow you to track your affiliate links in Google Analytics.

      Click on the Save and Continue button to save your settings.

      Next, MonsterInsights will show you paid add-ons that you can access if you upgrade to PRO. You can simply click on the ‘Save and Continue’ button to skip this step.

      Upgrade to pro

      After that, you will be asked to install WPForms plugin, which is the best WordPress contact form plugin. You can install it or simply click on ‘Skip this Step’

      Recommended plugin

      That’s all you have successfully installed and setup Google Analytics on your WordPress site. Remember, it will take Google Analytics sometime before showing your stats.

      Google Analytics successfully installed using MonsterInsights

      The best part about MonsterInsights is that you can view your Google Analytics reports inside your WordPress dashboard. Simply visit Insights &raqo; Reports page to check out a quick overview of your analytics data.

      Your Google Analytics reports in WordPress dashboard

      Note: MonsterInsights was formerly known as Google Analytics for WordPress by Yoast. WPBeginner’s founder, Syed Balkhi, acquired the plugin in 2016 and rebranded it to MonsterInsights. Now it is part of our family of premium WordPress plugins.

      2. Insert Headers and Footers Plugin

      This method is not as not as good as MonsterInsights because you will not be able to do advanced tracking configuration, and you will not be able to view Google Analytics data in your WordPress dashboard.

      First, you need to install and activate the Insert Headers and Footers plugin. For more details, see our step by step guide on how to install a WordPress plugin.

      Upon activation, you need to visit Settings » Insert Headers and Footers page. Here you need to paste the Google Analytics code that you copied in step 4 into the headers section.

      Adding Google Analytics tracking code using Insert Headers and Footers plugin

      Don’t forget to click on the save changes button to store your settings.

      That’s all, you have successfully installed Google Analytics on your site.

      3. Install Google Analytics in WordPress Theme

      This method is for advanced users who are familiar with the code. It is somewhat unreliable because your code will disappear if you switch or update the theme. We almost never recommend using this method.

      If this is your first time adding code to your WordPress files, then you should check out our guide on how to copy paste code snippets in WordPress.

      Add code in header.php file

      Simply edit the header.php file in your WordPress theme and paste the code you copied in step 4 right after the <body> tag.

      Don’t forget to save your changes and upload the file back to your server.

      Add via Functions File

      You can also add Google Analytics tracking code to WordPress functions file. It will then automatically add the tracking code to every page on your WordPress site.

      You will need to add this code to your theme’s functions.php file.

      <?php
      add_action('wp_head', 'wpb_add_googleanalytics');
      function wpb_add_googleanalytics()  ?>
      
      // Paste your Google Analytics code from Step 4 here
      
      <?php  ?>
      

      Viewing Reports on Google Analytics Website

      Google Analytics is capable of showing you a treasure of data collected from your stats. You can view this data by visiting your Google Analytics dashboard.

      Google Analytics reporting

      You will see the built-in Google Analytics reports in the left column. Each section is divided into different tabs and clicking on a tab will expand it to show more options.

      • Real-time This report will show you a real time view of your traffic.
      • Audience tab will show reports to help you understand your users.
      • Acquisition reports explore where your users came from.
      • Behavior reports summarize what your users do after they arrive on your site.
      • Conversion reports show how well you’re doing against your goals.

      Making the Most out of Google Analytics

      Google Analytics is an incredibly powerful tool with tons of awesome features. Some of them are quite obvious and easy to use, others require some additional setup.

      Here are some of the resources that will help you make the most out of Google Analytics reports.

      Google Analytics works best with Google Search Console (formerly Google Webmaster Tools). It allows you to see how your website is doing in search results. See our complete Google Search Console guide to learn how to use it to grow your website.

      We hope this article helped you learn how to install Google Analytics in WordPress. You may also want to see our ultimate WordPress SEO guide for beginners.

      If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

      The post How to Install Google Analytics in WordPress for Beginners appeared first on WPBeginner.



      Source link