How to Make Your WordPress Site EU Cookie Law Compliant

Featured Imgs 13

How to Make Your WordPress Site EU Cookie Law CompliantBy using cookies you can significantly improve user experience on your site. However, installing tracking cookies without express user consent constitutes a breach of the ePrivacy Directive 2002/58/EC (EU Cookie Law), and can result in a number of issues for European sites. This is why ensuring you make your WordPress site EU Cookie Law compliant […]

The post How to Make Your WordPress Site EU Cookie Law Compliant appeared first on WPExplorer.

How to Disable Directory Browsing in WordPress

Category Image 091

Do you want to disable directory browsing in WordPress?

Directory browsing can put your site at risk by showing important information to hackers which can be used to exploit vulnerabilities in your site’s plugins, themes, or even your hosting server.

In this article, we will show you how you can disable directory browsing in WordPress.

How to disable directory browsing in WordPress

What Does Disabling Directory Browsing in WordPress Do?

Every time someone visits your website, your web server will process that request.

Usually, the server delivers an index file to the visitor’s browser, such as index.html. However, if the server can’t find an index file, then it may show all the files and folders in the requested directory instead.

This is directory browsing, and it’s often enabled by default.

If you’ve ever visited a site and seen a list of files and folders instead of a webpage, then you’ve seen directory browsing in action.

A WordPress site with directory browsing enabled

The problem is that hackers can use directory browsing to see the files that make up your website, including all the themes and plugins that you’re using.

If any of these themes or plugins have known vulnerabilities, then hackers can use this knowledge to take control of your WordPress blog or website, steal your data, or perform other actions.

Attackers may also use directory browsing to look at the confidential information inside your files and folders. They might even copy your website’s contents, including content that you would usually charge for such as ebook downloads or online courses.

This is why it’s considered a best practice to disable directory browsing in WordPress.

How to Check is Directory Browsing is Enabled in WordPress

The easiest way to check whether directory browsing is currently enabled for your WordPress website is by simply visiting the /wp-includes/ folder link like this: https://example.com/wp-includes/.

You’ll want to replace www.example.com with your website’s URL.

If you get a 403 Forbidden or similar message, then directory browsing is already disabled on your WordPress website.

A website with directory browsing disabled

If you see a list of files and folders instead, then this means that directory browsing is enabled for your website.

A WordPress site with directory browsing enabled

Since this makes your website more vulnerable to attack, you’ll typically want to block directory browsing in WordPress.

How to Disable Directory Browsing in WordPress

To disable directory listing, you’ll need to add some code to your site’s .htaccess file.

To access the file, you’ll need an FTP client, or you can use the file manager app inside your WordPress hosting control panel.

If this is your first time using FTP, then you can see our complete guide on how to connect to your site using FTP.

After connecting to your site, simply open your website’s ‘public’ folder and find the .htaccess file. You can edit the .htaccess file by downloading it to your desktop and then opening it in a text editor like Notepad.

At the very bottom of the file, simply add the following code:

Options -Indexes

It will look something like this:

The WordPress .htaccess file

Once you’re done, save your .htaccess file and upload it back to your server using an FTP client.

That’s it. Now if you visit the same http://example.com/wp-includes/ URL, you’ll get a 403 Forbidden or similar message.

How to disable directory browsing in WordPress

We hope this article helped you learn how to disable directory browsing in WordPress. You may also want to see our ultimate WordPress security guide, or see our expert pick of the best WordPress membership plugin to protect your files.

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 Disable Directory Browsing in WordPress first appeared on WPBeginner.

10 Steps to Build a Personal Brand with WordPress

Featured Imgs 13

Build a Personal Brand with WordPressIt has never been easier for individuals to tell the world about themselves by creating a personal brand identity. Building a personal brand can demonstrate a person’s qualities and skills, defining what makes them unique or different. Any edge you can find on your competition is critical in today’s cutthroat business environment. Social media and […]

The post 10 Steps to Build a Personal Brand with WordPress appeared first on WPExplorer.

How to Split Large XML Files in WordPress (Free Tool)

Featured Imgs 13

Is your WordPress export file too large to import into your new website?

WordPress comes with built in import and export functionality that uses the XML file format. Sometimes the exported XML file is larger than your web host’s upload limit.

In this article, we’ll show you how to split large XML files in WordPress.

How to Split Large XML Files in WordPress

Why Split Large XML Files in WordPress?

When moving your blog from WordPress.com to WordPress.org or moving content from a self-hosted WordPress website to a to a new host or server, you will need to export your WordPress content.

WordPress allows you to export your entire WordPress website as a single XML file that contains all of your posts, pages, comments, custom fields, categories, and tags.

This is known as a WXR file and stands for WordPress Extended RSS.

You Can Export Your Website to an XML File

However, sometimes you may find that this file size is larger than the upload limit allowed by your WordPress hosting provider. If the file size is too large, then you will see an error message, and you will not be able to import your website data into the new WordPress installation.

This limit can vary, depending on your hosting provider and plan.

There Is a Limit to the Size of XML File That Can Be Imported

While you can ask your web hosting company to temporarily increase the file size limit, most shared hosting companies will not allow it.

So the only other option you have is to split the XML file into smaller files manually which is hard work.

Luckily, there’s an easy free online tool that can help you automatically split large WordPress XML files.

With that being said, let’s take a look at how to split large XML files in WordPress.

Bonus Free Offer

Need help? Our free WordPress blog setup service can help you migrate from WordPress.com to WordPress.org without any risk. During this guided transfer, one of our expert team members will do the entire migration from WordPress.com for you (100% free).

How to Split Large XML Files in WordPress

Once you have exported your WordPress site to a single XML file, you need to go to the Free WXR File Splitter Tool website. This is a free online tool that is designed to divide a large WordPress export file into small chunks.

Once there, you can upload your XML file by dragging it onto the area labeled ‘Click or drag a file to this area to upload’. Alternatively, you can click the ‘WXR File’ button and then select the XML file.

Upload the XML File to the Free WXR File Splitter Tool

After that, you need to move the ‘New file size’ slider to your website’s maximum upload size or smaller. The goal is to create multiple files that are small enough to be uploaded to your host without surpassing the limits.

When you are ready, you need to press the ‘Submit’ button. Your large XML file will be split into smaller files of the correct size.

Download the Split Files in a Zip File to Your Computer

Finally, you’ll need to press the ‘Download’ button to download the files to the default download location on your computer. The files will be contained in a single file which will need to be unzipped so that you can import them into your new website.

We hope this tutorial helped you learn how to split large XML files in WordPress. You may also want to learn how to create a free business email, or check out our list of the best drag and drop WordPress page builder 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 Split Large XML Files in WordPress (Free Tool) first appeared on WPBeginner.

Create Stunning Infographic With These Great Tips And Tutorials

Featured Image 01

Infographics are where data and information meet design. These graphic visual representations are able to quickly and effectively share knowledge with your audience. In Today’s post, you will learn how to create a stunning infographics with these very useful tutorials and articles. They will arm you with all the latest techniques and information to help...

The post Create Stunning Infographic With These Great Tips And Tutorials appeared first on DesignrFix.

Use a Form’s Style Everywhere (for Free!) with Forminator’s Global Appearance Presets

Category Image 052

Maintaining the same form styles and appearance across all of your forms has never been easier with Forminator’s Global Appearance Presets.

The look and style of a form you create with our free plugin, Forminator, can be replicated and used for all of your forms. Even change existing forms to your new style and appearance with a click of a button!

This article shows you how it’s done. We’ll be covering how to…

Using a form to your specification across multiple platforms is excellent for branding, saves you time, and helps manage your form creation as simple as possible.

Let’s get to it!

Update the Default Preset

Forminator starts from scratch with its Default preset. Before we dive into making new presets, here’s a look at how you can change the default settings.

The whole process begins in Settings and Appearance Presets. You’ll see at the top of the page an area called Preset.

A look at the preset dropdown.
This Preset dropdown is what shows up first.

The preset design that pops up is Forminator’s Default Preset.

The default design style
This is the blank slate of style for your form.

Underneath this, jazz things up for the default design. You have your choice of any Color, Hundreds of Fonts, Form Container, and even Custom CSS.

Check out all of the configurations options in our documentation and below…

There are a TON of configuration options.

When you have it edited according to your configuration, hit Update – and that’s it! We’ll talk about how to apply it to all of your forms and more coming up in this article.

Create a New Preset

Let’s say you want to create a new preset and leave the default one alone. Or, you decide to change the default configuration and make a new configuration. Either way – it’s simple to do!

We’ll head back to the banner on the top of the Settings and Appearance Presets web page. From there, it’s just a matter of clicking on the plus sign for a New Preset.

Where you add a new preset.
New Preset is a click away!

You’ll first give the form a Preset Name.

Where you create a preset.
This window will appear after hitting New Preset.

Additionally, you can import the style from an existing form that you created by clicking the Import Style From Form dropdown. It’s up to you.

List of created forms.
All of my current forms are displayed.

We’ll create a new preset for this example and name it Preset One. Once named, you’ll hit Create Preset.

Where you create a preset.
Name the preset anything you’d like!

After that, you’ll see the new preset in the dropdown.

The preset dropdown.
All of your presets will be shown here.

And that’s all it takes. If needed, you can access it at any time to edit.

All of your presets will appear in the dropdown. You can create unlimited amounts of presets as you want!

Apply Your Preset to Multiple Forms in Bulk

There are several ways to apply a preset to multiple forms – either in bulk or individually. All of this is done from Forminator’s dashboard under Forms.

Let’s say you want to apply a preset to ALL of your forms. That can be done in just a few clicks. Simply click the checkbox to the left of the dropdown, and click Apply Appearance Preset.

This updates all of the forms at once.

After choosing your bulk action, you’ll select which preset you’d like to apply. Select the one you’ll use from the dropdown, click Apply Preset – and you’re done.

Where you choose a preset
All the presets created will show in the dropdown.

Additionally, you can check only certain forms to apply the appearance preset. The choice is yours!

Add Preset to Individual Form

You can use the method I just touched on with bulk by checking the box to the form you want to change. However, there’s another option.

Each form has a Gear icon. When clicked, a dropdown appears of various functions (e.g. preview, duplicate, etc.). One of those options is Apply Preset.

The gear icon
All of your forms will have the gear icon.

Just like with bulk presets, you’ll choose which preset form you’d like to apply. The preset will then be applied to that individual form.

Looks and Style at Peak Per-FORM-ance

As you can see, it’s as easy as ever to apply Forminator’s Global Appearance Presets to all or individual forms. It makes branding and form creation much more manageable than starting from scratch with each new form you create.

This keeps the style of your form and looks consistent throughout, no matter where you’re using them.

If you haven’t yet, be sure to start using our Forminator plugin to implement this useful feature and check out the documentation if you need help. Forminator is free to use, with over 200k active installs and a solid 5-star review.

Keep your forms on form!

How to Move Content From One WordPress Site to Another

Featured Imgs 13

Moving your WordPress site to another location can be a stressful and fiddly experience, not helped by the fact you can’t just simply move your files and database. No, that’s just not how WordPress works.

Fortunately, WordPress has a handy “Import” and “Export” tool built in. But unfortunately, it’ll only suit some basic requirements and you need to improvise a little to achieve other effects.

In this article, I’ll show you step-by-step how to migrate your WordPress installation’s content to a new place.

Let’s get cracking!

Before We Start: Back Up Your Website

Some WordPress installations or server setups may present you with unique challenges on migrating content. Although this article will deal with an additional unique eventuality (namely that you only want to transfer a part of your WordPress installation’s content), there’s no guarantee that the steps detailed here will unfailingly work for every setup.

It goes without saying that you’re solely responsible for your site, even when following this guide to the letter; there’s some database work involved depending on what you want to do, and if you accidentally delete a huge chunk of your site, that’s down to you. Basically, be careful with this!

For the purposes of this post, I’ve created two separate localhost installations of WordPress to provide you with pictures of each step. You might like to try moving your content to a test site to check it works.

To that end, I’d recommend making a backup of your entire site at this point. Of course, you do that regularly, don’t you? (If not, you definitely should be. Get to it.)

If you want to do this manually, remember to include both your database and site files (primarily because this includes your website’s Uploads folder).

Backing Up Files

You can create and download a ZIP of your site files via FTP. How to do this varies per FTP client but is generally fairly obvious. Make sure you download and securely store your backup compressed file – just as with any backup.

Backing Up Your Database

Login to your phpMyAdmin account and select the database in which WordPress is installed.

Select Export from the top menu. For most people, “Quick” options will be adequate. However, if you have tables other than the WordPress installation you want to back up in the same database, click Custom to select the tables you want to back up; all other options should remain untouched. Finally, click Go to download your database backup file (.sql format).

phpMyAdmin Database Export Options
Your WordPress tables are prefixed “wp_” by default – since I have two installations in the same database, mine are actually prefixed wpmudev_export and wpmudev_import. Here, I’m backing up the wpmudev_export files.

Hopefully, those backups won’t be needed, but it’s always advisable before embarking upon such work. If the site to which you’re migrating content already has content, make sure you back up that one too.

With precautions out of the way, let’s get to work!

Changing Your WordPress Installation’s URL? Transferring a Whole Site

If you’re just looking to change your website to a new URL or otherwise want to transfer absolutely everything from one installation to another, the good news is that you’ve picked the easy option. WordPress’s own import and export tools will work perfectly for you so no need to do anything too complicated under the hood.

Here’s how to transfer all your WordPress content – pages, images and files, posts and everything else – to a new installation.

Incidentally, it is probably easiest to create a new installation on your new server (or even the new location within a server) and import/export than to change your files’ configurations. However, if you’d rather do it that way, the WordPress Codex can advise. Your installation should be up-to-date with the latest WordPress version so it won’t be a problem, but if it’s not, upgrade your old installation first. If you really can’t update for some reason – such as keeping a plugin that doesn’t work with new versions – your new installation can be an old version. This is far from recommended because many old versions of WordPress have critical security flaws.

How to Move Content From One WordPress Site to Another

  1. Export From Your Old Installation
  2. Install the Importer
  3. Upload Your Content
  4. Assign the Content

1. Export From Your Old Installation

WordPress Export Page.
WordPress’s own Export Tool.

Go to your WordPress dashboard and select the Export item from the Tools section.

Because you’re exporting everything, it’s easy: keep the All content option selected and hit Download Export File.

An XML file will be created. Keep it in a safe place and go across to the installation to which you’re migrating.

2. Install the Importer

WordPress importer options.
The WordPress importers screen.
Importer Install screen

On the new WordPress installation, go once again to Tools, but this time select Import.

You will be shown a list of importers, from which you should select the WordPress option.

Click Install Now and wait for the importer plugin to download and install.

If it all works, you can click Activate Plugin & Run Importer on the next screen.

At this point, you’re all ready to import and the XML file you generated earlier comes into play.

3. Upload Your Content

Screen to upload WXR XML file
Upload the WordPress eXtended RSS (WXR) XML file you created earlier.

Click Choose File on the screen that follows and select the XML file you created on the old site.

Next, click Upload file and import.

4. Assign the Content

Importer Content Attribution Options.
You can import or add new author accounts, or attribute content to existing authors. Ensure you import and download attachments.

You’ll be given an option to assign content to existing users on the new site (if you have an account on both, you can assign your old posts to your new account), or create new users either with their old usernames or with a new one you select. This ensures all the content is attributed to an author account that exists on the new site.

If you have any images or files to move to the new site, make absolutely sure that you tick Download and import file attachments – it’s not selected by default.

Hit the Submit button and you’re done! The page may take a little longer than usual to load because it’s creating all the new rows on the database, but it will get through it. Just wait patiently for it to be processed and all of your content should be imported onto the new site ready for its life there.

Partial Content Movement

So that’s the easy bit out of the way. However, if you’re looking to export only some of your content, I’m afraid to say that WordPress’s tools probably won’t cater for your needs on their own.

Selecting All content is the only way to export your attachments (files that appear under the Media section). Therefore, if you want to transfer specific parts of the content and your images, you’ll either need to move everything across then delete it (time consuming for larger sites) or poke around in your files and database – which I shall show you how to do now.

The exporting and changing SQL that I’m about to show you will be demonstrated for moving attachments, but you can also use a similar methodology to transfer the whole database across. This is useful if you want to transfer everything but your XML file is too large to upload through the importer.

1. Select the Content You Want to Export

Venture once more to the Tools > Export screen to begin with.

Export screen with posts selected.
Here I have chosen to export only posts after mid-2010 from a certain author. You can also choose to export by status (eg. Published, Pending, Draft) or their Category. Other content types like pages (or Feedback, Portfolio, etc. if enabled) can be selected.

Once you’ve selected which content you’d like to export, click Download Export File as before. If there are multiple selections you’d like to make (eg. two authors’ posts in a date range, or someone’s posts and all pages), it’s entirely possible to go back and create multiple export files for each selection.

2. Import as Before

After you have all the WXR XML files you want, go to the new site and install the WordPress Importer as previously shown. You can upload your files (one at a time) as before and they’ll install the specific posts/pages/other content onto the site.

However, this is not the end, because you’ll notice that you still don’t have any attachments (eg. uploaded images) on your installation quite yet.

3. Duplicate Media Files

Go to your old installation’s FTP client and find the /wp-content/uploads/ folder. I’m using Windows 10’s File Explorer as my FTP client, but most should be able to compress files and download them.

Sending to compressed (zip) file.
Depending on your FTP client, compressing all folders within your uploads directory into a .zip file will be done through different methods.

Download the .ZIP file you generate and upload it to your new site’s FTP (or cut and paste it if you can access both sites through your FTP client).

Moving uploads .zip.
I’m cutting and pasting my compressed uploads across, but you can download and upload if you need to change between FTP clients.

You can then extract all the files from the compressed folder into the Uploads directory.

Unfortunately, that’s not the end of it; while your files are in the right place, your WordPress installation won’t know about them because the attachment details haven’t yet been copied across from the database.

No media attachments found.
Your new WordPress database doesn’t know about the files you’ve uploaded to the new server yet.

4. Export Attachment Posts

Head over to your old site’s phpMyAdmin database and find the wp_posts table (replace wp_ with your prefix as necessary).

wp_posts table SQL.
Again, I used wpmudev_exportposts, but replace the table name with the right prefix as applicable to your database.

At this point, you need to find the attachment posts (those are the media posts) so paste in the following SQL (changing the table name to have the right prefix if necessary) and hit Go.

SELECT 
 * 
FROM 
 `wp_posts` 
WHERE 
 `post_type` = "attachment"
Executed SQL query.
The SQL query will return only attachment posts.

Scroll to the bottom of the query results and check Show all so all attachment posts are showing. Once all rows are displayed, choose Check All then click Export.

At this point, things get a bit more complicated, but stay with me and follow the steps carefully and you should be fine.

Custom wp_posts Export with Format Specific Options
For the purposes of the picture, the options you’ll need to change have been moved up the page. You may need to scroll down to find them.
  1. Choose Custom to show all possible settings.
  2. Scroll down to the Format-specific Options section.
  3. Choose data.
  4. Leave everything else as it is and click Go.

5. Edit Your SQL

This step is necessary if your new installation has a different database prefix to the one from which you’ve just downloaded your SQL export file.

Edit the .sql file using a text editor such as Notepad++, finding and replacing the old prefix with the new prefix.

Find and replace prefixes in SQL file.
In my case, my original database was prefixed wpmudev_export and the one to which I will be moving the attachments is prefixed wpmudev_import!

If your prefixes are the same (eg. both tables are wp_posts), that’s fine and you can ignore this step.

6. Import Attachment Posts

wp_posts Import Page.
As ever, find the table with the right prefix as applicable!

Go to your new database and find wp_posts (or equivalent); click Import.

Click Choose File – make sure you click, don’t drag it in, as this means it won’t be uploaded in the right place – and select the exported SQL file.

Leave all other options as they are and execute the query by hitting Go. You’ll see a success message once it’s finished and all your attachments will now be visible under Media – although there’s a further step before your images will start showing up properly.

Media library showing just files, no images.
As you can see, none of the images actually show as images…yet!

7. Export Post Meta

wp_postmeta Custom Export Options
Again, the options you need to change are on this picture. You may need to scroll to find them.

Similar to the previous database work, this time find your old installation’s wp_postmeta table and select the Export tab.

Select Custom settings again and choose data rather than structure and data, just as before.

This time, also locate the Data Creation Options heading and select REPLACE as the function to use when dumping data.

Once again, click Go to create and download your SQL file.

8. Edit Your SQL

wp_postmeta SQL file editing

Again, you need to change the prefixes in your SQL file if the new database prefix will be different. You should also find all references to your old URL and replace them with the new one.

9. Import Post Meta

Go to your new wp_postmeta (or other applicable prefix) table and, exactly as before, import your edited SQL file into the new installation.

Your media library is now complete once more, ready to fit back into your transferred content (finally).

Completed Media Library
Finally, all your images show up and can be shown within content!

Finishing Up

If you’ve got through all that, well done – it’s a bit of a roundabout method just to transfer some images across with specific posts.

Of course, there are still catches with this: if you only want to migrate some of the images, you need to go through and pick out the folders (hopefully you want them by date or it would take forever) more carefully when uploading. You could also run into trouble with duplicate primary keys transferring wp_posts if you already had posts on the new installation.

Clearly, to make the Import/Export process more intuitive – rather than requiring such creative thinking with the databases behind the CMS – some work will need to be completed for a future WordPress release. While we wait, however, if you do need to move some of your content, this should work for you – it’s well worth the time!

If you’ve got any more ideas and methods for moving across parts of a WordPress installation with all the content in tow, we’d love you to share it with us in the comments. Likewise, let us know if you’re having any issues with these methods and we can try to give you a hand.

Why and How to Automatically Translate a WordPress Site

Featured Imgs 13

Why and How to Automatically Translate a WordPress SitePersonalized content, friendly interfaces, and interactive themes help create engaging, accessible websites. But to truly reach a global audience, your website should speak your clients’ language. Fortunately, translating your site into any language is getting easier, quicker, and more affordable thanks to automatic translation options, also called machine translation, in many translation plugins. Why Translate […]

The post Why and How to Automatically Translate a WordPress Site appeared first on WPExplorer.

How to Limit the Number of Posts in WordPress RSS Feed

Featured Imgs 13

Do you want to limit the number of posts in your WordPress RSS feed?

By default, WordPress displays the ten most recent posts in the main RSS feed. You can change that to include more or fewer articles in the feed.

In this tutorial, we’ll show you how to easily limit the number of posts in the WordPress RSS feed. We’ll also show you how to easily create an RSS sitemap for search engines as well.

Limit number of posts in WordPress RSS feed

Video Tutorial

If you don’t like the video or need more instructions, then continue reading.

Change Posts Limit in WordPress RSS Feed

First thing you need to do is go to Settings » Reading page in your WordPress admin dashboard.

From here, you need to change the value next to the ‘Syndication feeds show the most recent’ option. Simply enter the number of posts you want to be shown in your RSS feed.

Change posts limit in RSS feed

Below this option, you’ll also see the option to show either the full text or excerpt of your posts in RSS feeds.

We recommend using the Excerpt option because it reduces the feed size and increases your page views.

After that, don’t forget to click on the Save Changes button to store your settings.

That’s all, you have successfully limited the number of posts displayed in RSS feed of your site.

Create RSS Sitemap for Search Engines

If you only want to change the number of posts in your RSS feeds for more search engine visibility, then increasing posts in your main WordPress RSS feeds is not the best way to do this.

Many popular search engines like Google and Bing support RSS sitemaps.

Unlike XML sitemaps which contain most of your content, an RSS sitemap provides search engines with the latest posts on your site.

This helps search engines quickly find the updated posts on your website. You can set a different limit of posts that you want to include without affecting your main WordPress RSS feed.

The easiest way to add an RSS sitemap in WordPress is by using All in One SEO for WordPress. It is the best WordPress SEO plugin on the market and allows you to easily optimize your website without any SEO skills.

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

AIOSEO setup wizard

This will bring up the All in One SEO setup wizard. Follow the on-screen instructions or check out our tutorial on how to properly set up All in One SEO for WordPress.

After that, you need to go to the All in one SEO » Sitemaps page and switch to the RSS Sitemap tab.

Enable RSS sitemap

From here you can enable the RSS Sitemap and also set the number of posts you want to include in the sitemap.

Set post limit for RSS sitemap

This sitemap includes all your post types. This means it will include posts, pages, products, or any custom post types you may have.

If you only want to include blog posts, then uncheck the ‘Include All Post Types’ and then select ‘Posts’.

Once you are satisfied, don’t forget to click on the Save Changes button to store your settings.

You can now click on the Open RSS Sitemap button to copy the URL of your RSS sitemap.

View RSS sitemap

Next, you need to submit your RSS sitemap to Google Search Console. See our step by step tutorial on how to add your WordPress site to Google Search Console.

We hope this article helped you limit posts in your WordPress RSS feed. You may also want to see our guide how to choose the best business VoIP provider and our expert pick of the must have WordPress plugins 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.

The post How to Limit the Number of Posts in WordPress RSS Feed first appeared on WPBeginner.

How to Add a Search Form in a WordPress Post With a Shortcode

Featured Imgs 13

Do you want to add a search form to a WordPress post?

Adding a search form to your post or page content is a good way to encourage your visitors to find more content and stay on your website longer.

In this article, we’ll show you how to add a search form in your posts and pages using a WordPress search shortcode.

How to Add Search Form in Your Post with a WordPress Search Shortcode

Why Add a Search Form to Your Posts and Pages?

If a visitor has enjoyed reading a post on your WordPress blog, then they will likely want to read more. Offering a search form in the post will help them find more of your content that they are interested in.

When you make it easy for users to spend more time on your website, you can increase your pageviews and reduce your bounce rate.

Your visitors are also more likely to join your email list, leave a comment, make a purchase, and follow you on social media.

In this tutorial, we’ll show you how to add the standard WordPress search form to your posts. If you want to add a custom search form, then see our step by step guide on how to create a custom WordPress search form.

We’ll show you two methods to add a search form to your posts, and the first is the simplest. Use the links below to jump to the method you’d like to use.

Method 1: Adding a Search Form with a Plugin

The easiest way to add a search form to your posts is by using the SearchWP plugin. It’s the best search plugin for WordPress used by over 30,000 sites.

Setting Up SearchWP

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

Upon activation, you need to visit the Settings » SearchWP page and then click on the ‘License’ menu option.

Enter SearchWP license key

You then need to enter your license key in the License box. You can find this information in your account on the SearchWP website. After that, you should click the Activate button.

Next, you need to click on the Engines menu option. This brings you to a screen where you can choose your search engine settings.

SearchWP engines settings

Here you need to create a site-wide search engine. You can adjust your search engine settings by clicking on the Posts, Pages and Media drop downs.

The Attribute Relevance sliders in each section adjust how the search engines value and rank content. For example, if you want to value the post title higher than the content, then you can adjust the sliders accordingly.

Adjust SearchWP slider settings

After you’ve finished adjusting the settings, make sure to click the ‘Save Engines’ button to save the default search engine.

Adding a Search Form to a Post

Now you need to download the SearchWP shortcodes extension to easily add your new custom post search form to WordPress.

You’ll need to visit the SearchWP Shortcodes Extension website and then click the ‘Download available with active license’ button.

Download SearchWP Shortcodes extension

After that, you need to install and activate the extension the same way you installed the plugin above. Now you can add a search form in your posts.

Simply edit the post and place your cursor where you want to add the search form. After that, click the plus ‘Add Block’ icon to bring up the blocks menu.

Insert a Custom HTML Block

Next, type ‘html’ into the search box. Then, select the ‘Custom HTML’ block.

Once you’ve added the new block, you can add the following shortcodes and HTML to your page. If you need more help, then see our guide on how to add a shortcode in WordPress.

[searchwp_search_form]
   
<div class="search-results-wrapper">
 [searchwp_search_results]
  <h2>[searchwp_search_result_link]</h2>
  [searchwp_search_result_excerpt]
 [/searchwp_search_results]
</div>
   
<div class="no-search-results-found">
 [searchwp_search_results_none]
 No results found, please search again.
 [/searchwp_search_results_none]
</div>
   
<div class="search-results-pagination">
 [searchwp_search_results_pagination direction="prev" link_text="Previous"]
 [searchwp_search_results_pagination direction="next" link_text="Next"]
</div>

This code will add a search form to the post, create a section to display the search results, show a no results message if necessary, and add pagination if the results go into multiple pages.

Make sure you click Publish or Update to save your post and make it live.

Click Publish or Update to Save Your Post

To see the search form in action, simply view the post on your WordPress website. This is how it looks on our demo site running the Twenty Twenty-One theme.

SearchWP Form Preview

For more tips on customizing your search, see our guide on how to improve WordPress search with SearchWP.

Method 2: Adding a Search Form Using Code

You can also add a search form to your WordPress posts by use of a code snippet. This method is not recommended for beginners, so if you’re not familiar with code, then you should use Method 1 instead.

In this method you will have to edit your theme’s functions.php file.

If you have not edited the functions.php file before, then take a look at our beginner’s guide on pasting snippets from the web into WordPress.

All you have to do is open your theme’s functions.php file or a site-specific plugin and paste the following code:

add_shortcode('wpbsearch', 'get_search_form');

Here is how it looks on our demo website when using the WordPress Theme Editor to add the snippet to the Twenty Twenty-One theme’s functions.php file.

Editing functions.php in the Theme Editor

After that, you simply add the shortcode [wpbsearch] to the post or page where you would like the search form to appear.

Search Form Shortcode

This will display the default search form. To see the search form, simply view the post on your WordPress website.

Search Form Preview

If you would like to display a custom search form, then you should use this code instead.

function wpbsearchform( $form ) {
  
    $form = '<form role="search" method="get" id="searchform" action="' . home_url( '/' ) . '" >
    <div><label class="screen-reader-text" for="s">' . __('Search for:') . '</label>
    <input type="text" value="' . get_search_query() . '" name="s" id="s" />
    <input type="submit" id="searchsubmit" value="'. esc_attr__('Search') .'" />
    </div>
    </form>';
  
    return $form;
}
  
add_shortcode('wpbsearch', 'wpbsearchform');

Feel free to modify the code to customize the search form as you would like.

We hope this tutorial helped you learn how to add a search for in your post with a WordPress search shortcode.

You may also want to learn how to create a free business email address, or check out our list of reasons why you should use WordPress 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.

The post How to Add a Search Form in a WordPress Post With a Shortcode first appeared on WPBeginner.

How to Create Additional Image Sizes in WordPress

Featured Imgs 13

Do you want to create additional image sizes in WordPress?

By default, WordPress automatically creates several copies of image uploads in different sizes. Additionally, WordPress themes and plugins can also create their own image sizes.

In this article, we’ll show you how to easily create additional image sizes in WordPress and use them on your website.

Creating additional image sizes in WordPress

Why Create Additional Image Sizes in WordPress?

Normally, all popular WordPress themes and plugins handle image sizes very well. For instance, your WordPress theme may create additional sizes to use as thumbnails on archive pages.

However, sometimes these image sizes may not fit your own requirements. You may want to use a different image size in a child theme or a post grid layout.

You can do this by creating additional image sizes in WordPress and then calling these sizes whenever you need them.

That being said, let’s take a look at how to create additional image sizes in WordPress.

Registering Additional Image Sizes for your Theme

Most WordPress themes including all the top WordPress themes support post thumbnails (featured image) feature by default.

However, if you are creating a custom WordPress theme then you will need to add support for post thumbnails by adding the following code to your theme’s functions.php file.

add_theme_support( 'post-thumbnails' );

Once you enable the support for post thumbnails, you can now use the functionality of registering additional image sizes by using the function add_image_size().

The add_image_size function is used in the following format:

add_image_size( 'name-of-size', width, height, crop mode );

Example code can look like the following:

add_image_size( 'sidebar-thumb', 120, 120, true ); // Hard Crop Mode
add_image_size( 'homepage-thumb', 220, 180 ); // Soft Crop Mode
add_image_size( 'singlepost-thumb', 590, 9999 ); // Unlimited Height Mode

Now if you notice, we have specified three different sorts of image sizes. Each has different modes such as hard crop, soft crop, and unlimited height.

Let’s cover each example and how you can use them in your own projects.

1. Hard Crop Mode

As you may notice, there is a “true” value added after the height. This tells WordPress to crop the image exactly to the size that we have defined (in this case 120 x 120px).

This method is used to ensure that everything is exactly proportionate. This function will automatically crop the image either from the sides or from the top and bottom depending on the size.

Hard crop images example

2. Soft Crop Mode

By default, soft cropping mode is turned on this is why you do not see any additional value added after the height. This method resizes the image proportionally without distorting it. So you might not get the dimensions that you wanted. Usually, it matches the width dimension and the heights are different based on each image’s proportion. An example display would look like this:

Soft crop example

Unlimited Height Mode

There are times when you have super long images that you want to use in your design, but you want to make sure that the width is limited. For instance, infographic images tend to be very long and usually wider than the content width.

This mode allows you to specify a width that will not break your design while leaving the height to be unlimited.

Unlimited height mode

Displaying additional image sizes in your WordPress theme

Now that you have added the functionality for the desired image sizes lets take a look at displaying them in your WordPress theme. Open the theme file where you want to display the image and paste the following code:

<?php the_post_thumbnail( 'your-specified-image-size' ); ?>

Note: This bit of code must be pasted inside the post loop.

That’s all you really have to do to display the additional image sizes in your WordPress theme. You probably should wrap it around with the styling that fits your need.

Regenerating Additional Image Sizes

If you are not doing this on a brand new site, then you probably will have to regenerate thumbnails.

The add_image_size() function only generates the sizes from the point it was added into the theme. This means any post images that were added prior to the inclusion of this function will not have new sizes.

To fix this, you need to regenerate the new image size for older images. This is made easy by the plugin called Regenerate Thumbnails. Once you install and activate the plugin, a new option is added under the menu: Tools » Regenerate Thumbnails

Regenerate thumbnails

You’ll see the option to regenerate thumbnail for all images or just the featured images. We recommend regenerating all images to avoid any unexpected behavior or broken images.

For more details, see our article on how to easily regenerate new image sizes in WordPress.

Enabling Additional Image Sizes for your Post Content

Even though you have enabled image sizes in your theme, the usage is limited only to your theme which does not make any sense.

All image sizes are being generated regardless, so why not make it available for the post author to use within the post content.

You can do this by adding the following code to your theme’s functions file.

function wpb_custom_image_sizes( $size_names ) {
    $new_sizes = array(
        'homepage-thumb' => 'Homepage Thumbmail', 
        'singlepost-thumb' => 'Infographic Single Post'
    );
    return array_merge( $size_names, $new_sizes );
}
add_filter( 'image_size_names_choose', 'wpb_custom_image_sizes' );

Don’t forget to save your changes after adding the code.

You can now go and upload an image to a WordPress post or page. In the image block settings you’ll see your custom image sizes under the ‘Image size’ option.

Choose your custom image size inside post editor

You and other authors working on your website can now select these size options when adding images to posts and pages.

We hope this article helped you learn how to create additional image sizes in WordPress. You may also want to see our article on the best image compression plugins for WordPress and our WordPress performance guide to improve your website speed.

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 Create Additional Image Sizes in WordPress appeared first on WPBeginner.

Make Headlines on Google News with SmartCrawl’s Free Google News Sitemap

Featured Imgs 13

Do you run a news site or blog or publish newsworthy content with WordPress? Then put your site on the Google News map with SmartCrawl’s Google News Sitemap…for Free!

Have you heard the good news?

If you are already using our powerful SmartCrawl WordPress SEO plugin and you want to add a Google News sitemap to your site, then look no further…SmartCrawl comes with its own built-in Google News sitemap so there’s no need to install an additional plugin.

So, if you run a news site, news blog, or publish newsworthy content with WordPress, read on to learn more about:

Google News
Use SmartCrawl’s Google News sitemap to get your news content published on Google News!

Why Use Sitemaps

We’ll keep this section short and sweet…

Sitemaps are useful tools for helping site visitors and search engines find content on your site.

An HTML site map helps human visitors navigate faster to content on your site and an XML sitemap helps search engine robots crawl and discover all of your content.

In addition to providing an XML sitemap that offers many advantages over the WordPress core sitemap such as performance caching, including images from post content, adding styling to the sitemap, automatic updates, and auto-notifying search engines, SmartCrawl also offers a configurable Google News sitemap.

SmartCrawl’s Google News sitemap is specifically designed to meet all of Google News technical requirements for a news sitemap feed.

How To Use SmartCrawl’s Google News Sitemap

To enable or disable SmartCrawl’s Google News Sitemap feature, select Sitemaps > News Sitemap in the SmartCrawl plugin menu.

SmartCrawl plugin menu - Sitemaps
Select Sitemaps in SmartCrawl’s menu.

Click Enable…

SmartCrawl Google News Sitemap screen.
SmartCrawl Google News Sitemap screen.

Once the feature is enabled, you will find fields for entering your Google News publication name (Note: your publication name must match the one you have set up on news.google.com) and the option to include post types (e.g. Posts, Pages, Products, etc.) or exclude posts by category or individual posts.

SmartCrawl Google News Sitemap settings screen.
SmartCrawl’s Google News sitemaps lets you control which posts are submitted to Google News.

Remember to click the Save Settings button when done.

View your Google News sitemap at yourdomain.tld/news-sitemap.xml.

SmartCrawl Google News Sitemap Feed
Your Google News Sitemap feed…powered by SmartCrawl!

Note: Only content published in the last 48 hours will be included in your News Sitemap. If no content is published during this time, your feed page will display an empty sitemap with no URLs.

For more details about using this feature, check out SmartCrawl’s News Sitemap documentation.

How To Add Your Website To Google News

You don’t necessarily need to have a news site to get approved as a publisher on Google News, but you must be publishing timely, topical articles, and newsworthy content on a regular basis.

Your site must also be an authoritative source of news in your industry or niche and your content must meet Google’s technical and quality guidelines to get approved.

Note: no amount of whitehat SEO tweaking (or blackhat SEO shenanigans) will get you listed on Google News if your site does not actually meet Google’s stringent criteria for inclusion.

Once Google approves you as a news publisher, you will have access to the Google Publisher Center – an interface where you can submit, manage, and monetize your content in Google News.

You can then copy your news feed URL and paste it into your Google Publisher account, under the publication you set up for your news site in your Google Publisher Center.

Rather than make this a lengthy post, we recommend visiting the Google Publisher Center Help section. It will explain everything you need to know and take you through the entire process of getting started with Google News and setting up your news publication.

Google Publisher Center Help section
Visit the Google Publisher Center Help section for all the information you need to get your site on Google News.

In addition to the above, we also recommend checking out this article from the Search Engine Journal and Neil Patel’s excellent tips on getting your website listed on Google News.

Extra, Extra, Read All About It!

If you run a WordPress-based news site, make sure to use SmartCrawl’s Google News Sitemap (available in both the free and pro versions) to get your good news published instantly and automatically.

And if you need any help installing or configuring SmartCrawl, check out our plugin documentation or contact our support team any time of day or night.

How to Add a Language Switcher to WordPress

Featured Imgs 13

How to Add a Language Switcher to WordPressSo, you’re thinking of going multilingual, aren’t you? Congrats on that decision! Growing your potential audience to international clients is always a good idea. But have you thought about your WordPress language switcher? Making your site multilingual entails more than just translating your website’s content. Of course, the translation is still the main part of […]

The post How to Add a Language Switcher to WordPress appeared first on WPExplorer.

How to Compress and Remove Original Images with Smush

Featured Imgs 13

Want greater control of your uploaded images? Smush lets you compress uploaded images, backup uploaded images, scale images to a desired threshold, disable scaling altogether, and more.

With Smush, you can now override WordPress Core functionality in the plugin’s settings to compress and remove original images.

We have tweaked the bulk smush engine and added several options that lets you choose how to manage this.

Before getting into the nitty-gritty, let’s explain what “originals” are (yeah, it can be confusing even for us).

Originals and Scaling

When WP version 5.3 was introduced in October 2019, WordPress decided to change how they handled big images.

Basically, WordPress defined a threshold (2560px is the default) and all images that were bigger than that would be scaled down, leaving users with all the usual generated attachments, plus the scaled version, plus the actual big image that you uploaded.

To quote the WordPress team:

If an image height or width is above this threshold, it will be scaled down, with the threshold being used as max-height and max-width value. The scaled-down image will be used as the largest available size.

Note: The scaling only works with JPEG images as the WP Core Team removed this functionality from PNG files due to a number of issues.

Use Cases

There are various reasons why you would want to compress your uploaded images or even go one step further and disable the default WordPress scaling functionality altogether.

For example, you may have users that don’t know that uploading 20MB images directly from their camera is not a good practice when it comes to using images with WordPress.

Or, images may be taking up a lot of space on your server and for various reasons, you can’t do anything but try to compress these.

The point is…you have your reasons and Smush allows you to choose how to handle images to better suit your workflow. :)

How Does it Work?

Whether you have Smush free or Smush Pro installed, go to Bulk Smush > Settings and scroll down a little.

You will find several new options:

Bulk Smush Settings
Manage your uploaded images better with Smush’s image resizing and uploading image features.

Resize uploaded images lets you change the default max image width and height threshold defined by WordPress (2560px) to other dimensions.

Disable scaled images allows you to completely disable the scaling functionality, which means that WordPress won’t create scaled versions of your uploaded images if they’re larger than the threshold. Basically, this lets you go back to how WordPress managed large-sized images before v5.3.

Enabling Compress uploaded images allows you to smush those huge images that we talked about earlier. No more 20MB+ images taking up space in your server (unless you really want it to!).

Smush also gives you the option to back up your uploaded images.

If you want to compress your scaled images, you’ll see the threshold size you defined (for example, 2048×2048) as another item under Bulk Smush > Image Sizes > Custom.

Bulk Smush Settings - Image Sizes
Compress your scaled images, including your defined image threshold size.

Under Tools > Bulk restore, you can restore your thumbnails as long as you enabled the option to back up your uploaded images.

Smush Bulk Restore
Regenerate your image thumbnails from your original uploaded images.

Give this feature a spin and start managing your uploaded images better in WordPress. If you need additional information, check out our Smush plugin documentation or contact our support team.