Tuesday, November 1, 2022

How to Stop Search Engines from Crawling a WordPress Site

Recently, one of our users asked us how they can stop search engines from crawling and indexing their WordPress site.

There are several scenarios when you would want to stop search engines from crawling your website and listing it in search results.

In this article, we will show you how to stop search engines from crawling a WordPress site.

How to Stop Search Engines From Crawling a WordPress Site

Why Stop Search Engines From Crawling a WordPress Site?

For most WordPress websites, search engines are the biggest source of traffic. You may ask, why would anyone want to block search engines?

Here are some situations when you won’t want search engines to index your website:

  • When starting out, you may not know how to create a local development environment or a staging site, and instead develop your website while it’s live. You won’t want Google to index your site when it’s under construction or in maintenance mode.
  • There are also many people who use WordPress to create private blogs. They don’t want them indexed by search engines because they’re private.
  • You can use WordPress for project management or an intranet. In these cases, you won’t want your internal documents to be publicly accessible.

A common misconception is that if you don’t have links pointing to your domain, then search engines will probably never find your website. This is not completely true.

For example, there may be links pointing to your site because the domain name was previously owned by someone else. Also, there are thousands of pages on the internet that simply list domain names. Your site may appear on one of those.

With that being said, let’s take a look at how to stop search engines from crawling your website. We’ll cover four methods:

Method 1: Asking Search Engines not to Crawl Your WordPress Site

This is the simplest method but does not fully protect your website from being crawled.

WordPress comes with a built-in feature that allows you to instruct search engines not to index your site. All you need to do is visit Settings » Reading and check the box next to ‘Search Engine Visibility’.

Search Engine Visibility Setting in WordPress

When this box is checked, WordPress adds this line to your website’s header:

<meta name='robots' content='noindex,follow' />

WordPress also modifies your site’s robots.txt file and adds these lines to it:

User-agent: *
Disallow: /

These lines ask robots (web crawlers) not to index your pages. However, it is totally up to search engines to accept this request or ignore it. Even though most search engines respect this, there’s still a chance that some pages or images from your site may get indexed.

If you want to make it impossible for search engines to index or crawl your website, then you will need to password protect your WordPress site using Methods 3 or 4.

Method 2: Asking Search Engines not to Crawl Individual Pages

You might want search engines to crawl and index your website, but not include certain posts or pages in search results pages.

The easiest way to do that is

using the All in One SEO (AIOSEO) plugin. It is the best SEO tool for WordPress and is trusted by over 3 million businesses.

For this tutorial, we’ll be using the AIOSEO free version as it includes the SEO Analysis tool. There is also a premium version of AIOSEO that offers more features like sitemap tools, redirection manager, schema markup, robots.txt editor, and more.

The first thing you’ll need to do is install and activate the AIOSEO plugin on your website. You can learn how to install and configure the plugin by following our step by step guide on how to set up All in One SEO for WordPress.

Once the plugin is set up, you can use it to ask search engines not to index certain posts and pages.

Again, it is totally up to search engines to accept this request or ignore it.

Simply edit the post or page that you don’t want to be indexed. You need to scroll down to AIOSEO Settings at the bottom of the WordPress editor and then click the ‘Advanced’ tab.

AIOSEO Advanced Settings

Notice that the article is using the default robots settings. To change this, you need to switch the ‘Use Default Settings’ toggle to the off position.

Asking Search Engines Not to Index a Single Page

Now you can click the ‘No Index’ checkbox. Once the post is published or updated, search engines will be asked not to index it.

Method 3: Password Protecting an Entire Site Using cPanel

If your WordPress hosting provider offers cPanel access to manage your hosting account, then you can protect your entire site using cPanel. All you have to do is log in to your cPanel dashboard and then click on the ‘Directory Privacy’ icon in the ‘Files’ section.

Using cPanel's Directory Privacy Feature

Next, you need to find the folder where you installed WordPress. Usually, it is the public_html folder. After that, you need to click the ‘Edit’ button next to that folder.

Edit the Root Folder
Note: If you have multiple WordPress sites installed under public_html directory, then you need to click on the public_html link to browse those sites, and then edit the folder for the website you want to password protect.

This brings you to a screen where you can turn on password protection.

Simply check the box that says ‘Password protect this directory’ and click the ‘Save’ button. If you like, you can also customize the name for the protected directory.

Check the Box to Password Protect This Directory

You will see a confirmation message saying that the access permissions for the directory have been changed.

Next, you should click the ‘Go Back’ button.

cPanel's Directory Privacy Success Message

You’ll be taken to a screen where you can create a username and password that will need to be used when accessing this directory.

You need to enter a username and password and then confirm the password. Make sure to note your username and password in a safe place, such as a password manager app.

Add a Username and Password

Once you click the ‘Save’ button you have successfully added password protection to your WordPress site.

Now, whenever a user or search engine visits your website they will be prompted to enter the username and password you created earlier to view the site.
A Username and Password Are Now Needed to Access Your Website

Method 4: Password Protecting WordPress With a Plugin

If you are using a managed WordPress hosting solution, then you may not have access to cPanel. In that case, you can use a WordPress plugin to password protect your site.

Here are the two most popular solutions:

  1. SeedProd is the #1 coming soon and maintenance mode plugin for WordPress, used on over 800,000 websites. It comes with complete access control and permissions features that you can use to hide your website from everyone including search engines. We have a step by step how-to guide for SeedProd.
  2. Password Protected is a very simple way to password protect your WordPress site with a single password (no user creation needed). See our step by step guide on how to password protect a WordPress site.

We hope this article helped you stop search engines from crawling or indexing your WordPress site. You may also want to learn how to speed up your website performance, or see our ultimate step by step WordPress security 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 Stop Search Engines from Crawling a WordPress Site first appeared on WPBeginner.


November 01, 2022 at 11:58PM

How to Easily Serve Scaled Images in WordPress (Step by Step)

Are you looking to serve scaled images on your WordPress site?

Beginners often slow down their websites by uploading images without paying attention to their size. Serving images that have the correct dimensions will improve your WordPress performance without reducing quality.

In this article, we’ll show you how to easily serve scaled images in WordPress.

How to Easily Serve Scaled Images in WordPress (Step by Step)

Why Serve Scaled Images in WordPress?

On your WordPress website, you’ll need images for your blog posts, thumbnails, page headers, cover images, and more.

Depending on your theme, these images will occupy a certain number of pixels. For example, your featured image might occupy 680×382 pixels, and a thumbnail 100×100 pixels.

It is important to use images that have been scaled to fit the correct dimensions needed for your site. For example, if your featured images occupy 680×382 pixels, then you should save them at exactly that size.

Otherwise, your site can be slowed down or the quality of the user’s experience will be lowered. Here are a few of the common reasons for this:

  • Your visitors will have to download larger files than necessary, increasing load times.
  • If you use images with fewer pixels than the space allowed, then they will look blurry when displayed at a larger size.
  • Your website will have to change the image sizes on the fly, which means it has to run more processes before it can show the content to users

Regardless, it will give your users a bad experience and may also have a negative impact on your image SEO.

That’s why if you test your website performance using GTMetrix scan, it will often recommend that you serve scaled images to speed up your website.

GMetrix Recommends Serving Scaled Images

With that being said, let’s take a look at how to easily serve scaled images in WordPress. We’ll cover two methods:

Method 1: Serving Scaled Images With a Plugin

The simplest way to serve images scaled is to use a plugin that automatically displays your website images at the correct size. This method is the easiest but doesn’t allow as much flexibility as the second method.

The free Optimole plugin is one of the best WordPress image compression plugins and will automatically scale your images. However, if you get over 5,000 visitors per month, then you’ll need the premium version.

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

Upon activation, you will be automatically taken to the Media » Optimole page and asked to sign up for an API key or enter your existing API key. This is very easy.

You Need an Optimole API Key

Simply make sure that your email address is correct, then click the ‘Create & connect your account’ button. The connection to Optimole will then happen automatically. You won’t even need to visit another website or manually paste the key.

Optimole will now start to optimize your images in the background. It will automatically choose the correct image size for each visitor’s device and browser, and the images will be served from the fast Optimole Cloud Service CDN.

Optimole Starts to Optimize Your Images Automatically

When you click on the Settings tab, you will see that the images in your posts and pages will be automatically replaced with those optimized and scaled by Optimole.

This isn’t done on the fly because it’s through a CDN, meaning your site will not take a performance hit.

The Default Settings Work for Most Websites

Also, the plugin has enabled lazy load, which means that images on the page that are not currently visible won’t be loaded until they are needed. This is another effective way to reduce page load time and improve website performance.

These settings will work well for most websites. However, you can customize Optimole further using the settings on the ‘Advanced’ menu to see what works best for your website.

If you make any changes to the settings, then don’t forget to click the ‘Save changes’ button at the bottom of the page.

Method 2: Serving Scaled Images Manually

You can also scale images without a plugin. There are three ways to do this: you can use the image editing software, the image editing feature in the WordPress Media Library, or by changing the values in the WordPress Media Settings.

Scaling Images With Image Editing Software

You can scale your images to the right dimensions before you upload them to your website by using photo editing software on your computer, such as Adobe Photoshop or Affinity Photo.

The software allows you to choose the correct number of pixels for your image and save it with a small file size and the file format you prefer.

For example, here’s a screenshot demonstrating Affinity Photo’s crop tool.

Cropping an Image With Affinity Paint

Besides getting the image size right from the beginning, there are other things you can do before you upload your images to make sure they don’t slow down your website.

For more information, see our guide on how to optimize images for web performance.

Scaling Images in the WordPress Media Library

Did you know that you can do basic image editing in WordPress? The WordPress ‘edit image’ feature allows you to crop, rotate, flip, and scale images.

When editing a post or page, you need to click on the image you wish to edit. Next, you should click the ‘Replace’ button and then select ‘Open Media Library’ from the menu.

Replace the Image from the Media Library

This will open the WordPress Media Library with the image selected.

On the right is an area where you can add alt text, a title, a caption, and a description for your image. You will also find an ‘Edit Image’ link.

Just click that link to be taken to the ‘Edit image’ page.

Click the Edit Image Link

Here you’ll find a preview of the image, editing buttons, and several other options that are useful when scaling or cropping the image.

To scale the image, simply change one of the ‘New dimensions’ values under Scale Image on the right.

Scaling an Image

For example, this image has a very large resolution of 2560×1637 pixels. We can reduce it to a width of 1200 pixels by typing in the first ‘Scale Image’ field.

All you have to change is the Width because the image’s height value will be changed change automatically to keep the image in proportion.

After that, just click the ‘Scale’ button to change the resolution of the image.

Note that you can only scale an image down in WordPress. You cannot make images larger by increasing the image dimensions.

For detailed instructions, see our guides on how to do basic image editing in WordPress and how to crop and edit WordPress post thumbnails.

Adjusting Image Sizes in Media Settings

When you upload images to your website, WordPress automatically creates several copies in different sizes. You can customize these sizes by visiting the Settings » Media page in your WordPress admin area.

The Media Settings Page

Here, you can easily change the dimensions for thumbnail, medium, and large image sizes.

On some websites, you may need more image sizes than just thumbnail, medium, and large. You can learn how to create these sizes by following our guide on how to create additional image sizes in WordPress.

If you change the default image sizes or create additional image sizes, then only new images will be affected. You need to regenerate the image sizes for existing images.

When you add an image to a post or page, you can select an image size in the block settings on the left of the page.

Select Image Size in a Post or Page

We hope this tutorial helped you learn how to serve scaled images in WordPress. You may also want to learn how to create a landing page or check out our list of social media plugins for 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 How to Easily Serve Scaled Images in WordPress (Step by Step) first appeared on WPBeginner.


November 01, 2022 at 04:05PM

Monday, October 31, 2022

How to Add Google Web Stories to Your WordPress Site

Do you want to add Google Web Stories to your WordPress website?

Stories are a popular publishing format used by Instagram stories, Facebook stories, Snapchat, YouTube shorts, and more. Google Web Stories allows you to create and host this kind of content stories on your own website.

In this article, we’ll show you how to easily add Google Web Stories to your WordPress website.

Adding Google Web Stories in WordPress

What is Google Web Stories?

Stories are a popular short-form content style used by social media platforms like Instagram, Facebook, Snapchat, and even YouTube. They might not always be called the same thing, but they all do the same thing.

They are tappable interactive slides with rich media content like images, music, and videos. All these elements make them highly engaging.

Google Web Stories

Engaged users are more likely to convert and spend more time on your WordPress website, which means more sales, conversions, and growth for your business and brand.

However, creating stories on third-party social platforms limits your ability to reach more audiences.

Google Web Stories allows you to bring the same story format to your own website. Enabling you to create highly engaging stories from your WordPress dashboard and publish them on your site.

Google Web Stories can be indexed and may appear in Google search results and Discover.

Stories in Google Discover

They use the AMP format, support structured data, and can even be monetized using Google AdSense.

That being said, let’s take a look at how to easily add Google Web Stories to your WordPress site.

Adding Google Web Stories in WordPress

First, you need to install and activate the Web Stories plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.

Web Stories is a free plugin developed and maintained by Google. It aims to popularize the web stories format and bring it to self-hosted, independent websites.

Upon plugin activation, head over to the Stories » Dashboard page to create your first story.

You can get started by selecting one of the templates as a starting point for your story or clicking on the ‘Create New Story’ button to start from scratch.

Create new story

We recommend starting with a template as it gives you a good head start and is much easier for beginners.

Once you choose a template, the plugin will launch the story builder interface. It is similar to the popular drag-and-drop page builder plugins for WordPress.

story builder

You can simply point and click on any element to edit it, or add new elements from the left column.

You can add audio, video, images, text, headings, stickers, emojis, and more.

Add elements to your web story

If you are using a template, you’ll see additional pages generated by the template at the bottom.

You can move between pages by clicking on them. You can also delete a page or add a new page if needed.

Manage pages in your story

You can also click on a page to set a background color or media.

When choosing a background color for your page, you’ll also find the option to add a call to action button.

Background color and call to action button

Simply add a URL and choose between the dark or light themes.

Optionally, you can also add an icon to your call to action button and make the link sponsored / nofollow.

Similarly, if you have WooCommerce installed, then you can also display products.

Adding products in web story

However, you’ll first need to turn on the WooCommerce integration in plugin settings (we show you how to do this later in our article).

Once you are satisfied with the story, you can switch to the ‘Document’ tab in the left column to configure publish settings.

From here, you need to upload a publisher logo (your website logo or site icon would work fine here) and a poster image for your story.

Document settings

Ideally, a poster image should be in a 3:4 ratio and a minimum of 640 x 853 pixels.

Don’t forget to provide a title for your story and a description. This will help optimize your story for SEO and improve its discoverability.

Below that, you can choose how you want pages to be advanced. By default, pages will change in 7 seconds, you can change that or let users manually tap to change the page.

Additional story settings

Finally, you can choose categories and tags for your story. This step is optional, but assigning your story to a category and adding some tags will help with SEO.

You are now ready to publish your web story. Simply click on the ‘Publish’ button at the top right corner of the screen.

Publish story

You will be shown a pre-publish checklist. If everything looks good, then click on the publish button to put your story live.

Displaying a Web Story in WordPress

The plugin will show you an option to add your story to a new blog post when you publish it.

Add story to a post or page

However, you can also add your story to any existing post, page, or sidebar.

Simply edit the post or page where you want to display the story and add the Web Stories block to the post editor.

Web stories block

Under the block settings, you will be able to choose multiple stories, latest stories, or a single story.

If you select the latest stories or multiple stories options, then you will also see additional display options to display stories in a circle, carousel, list, or grid options.

Stories block settings

Once you are satisfied with the post, click on the ‘Update’ or ‘Publish’ button to save your changes.

You can now visit your website to see your web stories in action.

Here is how it looked on the homepage of our test site in the multiple-story carousel format.

Web stories mobile preview

The web stories are their own custom post type within WordPress, which means you can display them just as you would any other page or post in WordPress, too.

For instance, they have their own archive page that you can use as a landing page for visitors, or you could highlight them individually as you would a WooCommerce product (which is also displayed using a custom post type).

Adding Integrations to Google Web Stories

The Web Stories plugin comes with a few built-in integrations that you can turn on.

You can find these integrations on the Stories » Settings page.

Adding Google Analytics to Web Stories

First, you can add your Google Analytics profile ID here. This will allow you to track your story views in your Google Analytics reports.

Web stories Google Analytics

Note: Web stories don’t support the newer GA4 Google Analytics tracking. It only supports Universal Analytics tracking ID which starts with ‘UA.’

If you are using MonsterInsights, then you can find your Google Analytics tracking ID under the Insights » Settings page.

GA profile ID

If you are not using MonsterInsights, then you can find the tracking ID in Google Analytics.

Just head to the ‘Admin’ tab and click on ‘Property Settings.’

Google Analytics tracking ID in GA dashboard

Adding Custom Fonts to Web Stories

If you want to use a specific font in Web Stories, then you will need to manually upload it to your website using FTP.

Simply upload the font file to /wp-content/ folder on your website. Once uploaded, your uploaded font location would be:

http://example.com/wp-content/font-file-name.ttf

Don’t forget to replace example.com with your own domain name and font-file-name.ttf with the actual font file name.

After that, you can copy and paste this URL in Stories » Settings under the custom fonts section.

Add custom fonts

Adding Monetization Integrations in Web Stories

Web Stories supports Google AdSense and Google Ad Manager for monetization options.

Select your monetization option and enter the required information. For instance, you will need Publisher ID and Ad Slot ID for the ad unit.

Monetization options

Enable Ecommerce Integration for Web Stories

If you are using WooCommerce or Shopify to run your online store, then you can enable eCommerce support for Web Stories.

This will allow you to add products to your web stories.

Simply scroll down to the Shopping section under Stories » Settings page and select your eCommerce platform from the drop-down menu.

eCommerce integration for WooCommerce

For WooCommerce, the plugin will automatically start showing your products.

For Shopify, you will need to provide your store address and generate an API access token.

Shopify integration

If you don’t have one yet, just click the link that says ‘learn how to get one,’ and you will be taken to instructions on how to generate your Shopify API token.

We hope this article helped you add Google Web Stories to your WordPress site. You may also want to see our guide on getting more traffic to your website or see our tips on tracking conversions 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 How to Add Google Web Stories to Your WordPress Site first appeared on WPBeginner.


October 31, 2022 at 03:06PM