Tag - Posts

How to Bulk Delete WordPress Posts (2 Easy Solutions)


Do you want to bulk delete WordPress posts? WordPress makes it super easy to manage posts from the admin area. However, if you want to delete a lot of posts then selecting and deleting them may take some time. In this article, we will show you two quick and easy solutions to bulk delete WordPress posts from your blog.

Bulk delete WordPress posts with two easy methods

Method 1. Bulk Delete WordPress Posts without Plugin

This method is easier and is recommended for all users. It uses the built-in WordPress functionality to quickly select a large number of posts and delete them.

First, you need to visit Posts » All Posts page. From here you can click on the bulk select box on top to select all posts displayed on the page.

Select all posts

If you don’t want to delete all of the selected posts, then you can now go ahead and uncheck those posts. Otherwise, you can click on the ‘Bulk Options’ drop-down menu and select ‘Move to Trash’ option.

Move to trash option

Next, you need to click on the ‘Apply’ button to delete selected posts.

WordPress will now move the selected posts to trash.

Using this default method, you can only select 20 posts at a time. What if you wanted to delete hundreds of posts?

Simply click on the ‘Screen Options‘ button at the top right corner of the screen. This will bring a pull-down menu where you need to change the ‘Number of items per page’ to any number you want.

Change the number of posts to be displayed

Next, click on the Apply button and WordPress will display the number of posts you selected earlier. You can now go ahead and bulk delete posts as described above.

Note: Deleted posts will be moved to WordPress trash and will remain there for 30 days. After that, they will be permanently deleted from your WordPress database.

Bulk Delete Posts by Specific Author or Category

Now let’s suppose you want to delete posts filed under a specific category / tag or written by a specific author? You can simply click on the author, category, or tag links to display posts associated with them.

Display posts by author, category, or tag

For example, clicking on the ‘News’ category will show you the list of posts filed under that category. You can then select the posts and move them to trash by using the Bulk Options menu.

Method 2: Bulk Delete WordPress Posts using a Plugin

The default bulk delete options are quite adequate for most users. However, there are some cases where you may need more options to quickly select specific posts and then bulk delete them.

For example, if you want to delete posts filed within last few days or posts older than a certain number of days?

Luckily, there is a plugin that lets you bulk delete posts using advanced filters.

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

Upon activation, go to Bulk WP » Bulk Delete Posts page in your WordPress admin area to delete posts. The plugin offers multiple ways to filter and select posts that you want to delete.

Bulk WP Settings

You can filter posts by duration, select posts published in last x days, delete them instantly without sending to trash, and even schedule to delete later.

As you scroll down further in the settings screen, you will find more options to select and delete posts by categories, custom taxonomies, custom post types, and more.

Sort and select posts by category

Bulk Delete can also be used to bulk delete comments, pages, users, and custom fields.

We hope this article helped you learn how to easily bulk delete WordPress posts using these two methods. You may also want to see our list of the best WordPress plugins for business websites.

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 Bulk Delete WordPress Posts (2 Easy Solutions) appeared first on WPBeginner.





Source link

Read more...

How to Check If Your WordPress Blog Posts Are Ranking for the Right Keywords


Do you want to check if your WordPress posts are ranking for the right keywords? Most beginners manually check rankings for their articles by typing keywords in Google. This does not give you an accurate idea of where your articles stand for the target keyword. In this article, we will show you how to easily check if your WordPress blog posts are ranking for the right keywords.

Checking WordPress posts ranking for right keywords

Why Check Keyword Rankings for Your WordPress Posts?

If you follow our complete WordPress SEO guide, then you will learn how to optimize each article on your website for specific keywords. This helps you get more traffic to your website.

Most beginners simply search on Google to see if their posts are appearing for those keywords. Even then, they usually only check the first page or probably the second page at best.

The issue is that sometimes your article might be ranking way below the first two pages or worst it may not even be ranking for the keyword that you want.

If you rely on manually checking your keyword rankings, then you are missing out useful information that you can use to improve your SEO rankings and increasing traffic.

That being said, let’s take a look at how to properly check keyword rankings for your WordPress blog posts,

1. SEMRush

SEMRush

SEMRush is one of the best SEO and Keyword research tool on the market. It is a comprehensive SEO suite with all the useful tools you’ll need.

It comes with a powerful organic research tool that can show keyword rankings for any domain name. You don’t need to type in URLs for individual articles. It will automatically fetch results for all URLs of that domain name.

SEMRush organic keyword analysis

Simply enter the domain name you want to look up and SEMRush will get a ton of information. After that, click on the organic research tab to view the full list of all keywords your website is ranking for.

You can sort the results by position, URL, traffic, and more. You can also export the results to a CSV file and research offline using your favorite spreadsheet program.

You can also track specific keywords with SEMRush, and they track those keywords on your dashboard, so you can instantly see their performance.

SEMRush can do the same things for any domain name which means you can enter your competitor’s domain name and see which keywords they are ranking for. You will also be able to see their paid search traffic, paid keywords, and other useful information that you can utilize to outrank them.

2. Google Search Console

Google Search Console

Google Search Console (formerly Webmasters Tools) is a set of tools offered by Google to help webmasters improve their website for search. See our guide on how to add your website to Google search console.

You can see your website’s performance in search results, impressions, click through rate, position, and more. It also allows you to submit XML sitemap which helps Google crawl your website more intelligently.

To view your keyword positions, click on the Performance report and then click on average position score.

Finding your keyword positions in Google Search Console

Search Console will now load your reports with average position column included. Next, you need to scroll down a bit to see the full list of keywords your site ranks for.

Keyword positions in search results

Next to each keyword, you will see how many clicks it gets, impressions, and position in search results.

You can sort the results by clicks, impressions, and position columns. By sorting using position, you will be able to see your top ranking keywords. As you scroll down, you will be able to see keywords where your site appears deeper in search results.

You can also export this data and open it with your favorite spreadsheet software.

3. Ahrefs

Ahrefs

Ahrefs is another popular SEO Tool among professional marketers. It comes with an easy to use interface and tries to make information understandable even for new users.

Simply enter your website domain name in the search box, and it will create a neatly organized report with beautiful graphs and charts.

Ahrefs report overview

You will find all your keyword rankings under the organic keywords report. Next to each keyword, you’ll be able to see its search volume, keyword ranking position, keyword density, and more.

Keywords report

Using Keyword Rankings to Get More Traffic in WordPress

Now that you have learned how to check keyword rankings for your WordPress site, let’s talk about improving your rankings.

Analyzing which keywords need improvement

It’s important to note that not all keywords are created equal.

For example, ranking #5 on a high traffic keyword is way better than ranking #1 for a low traffic keyword.

There are certain aspects to this data which you may want to consider.

For example, appearing on #1 position may not always bring you the most traffic. You will see some of your keywords ranking pretty well but not getting significant clicks or impressions.

During this research, you might also find some surprise keywords that you didn’t know you were ranking for. If these keywords have significant impressions and search volumes, then you should see if you can make strategic changes to your content to improve rankings for those keywords as well.

Improving rankings for specific keywords

After you have decided which keywords you will be working on, you can go ahead and see which of your articles are ranking on those keywords and what you can to optimize them better.

Here are a few tips:

Keyword density: See how many times the keyword appears in your content. You can do that using Yoast SEO plugin. Simply enter the ‘Focus Keyword’ in SEO meta box and it will show you the analysis including the keyword density.

See keyword density

Outdated Information Your article can be old, not have enough content, or contains outdated information. Updating it with newer information and just improving the content can give it an SEO boost.

Internal Linking Internal linking is when you link an article from other pages of your site. Linking to an article in other related content can give it an SEO bump. Use your target keyword as the anchor text when linking to it from other articles on your website.

For more details on this topic, please see our article on how to optimize your WordPress blog posts for SEO.

Learn What Your Visitors are Doing on Your Website

SEMRush and Google Search Console can help you find your keyword positions, but they can’t show you how many visitors are coming to your articles, where they are from, and what they do when they are on your website.

All of this information is crucial when planning your content strategy to rank for certain keywords.

This is where Google Analytics comes in. It shows you the number of pageviews for your articles, your top content, your visitor information, and more.

Google Analytics can be difficult to setup for beginners, that’s why we recommend using MonsterInsights. It is a Google Analytics plugin for WordPress that will help you easily install Google Analytics and see all reports inside your WordPress dashboard.

We hope this article helped you check if your WordPress posts are ranking for the right keywords. You may also want to see our guide on actionable tips to drive traffic to a new WordPress site.

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 Check If Your WordPress Blog Posts Are Ranking for the Right Keywords appeared first on WPBeginner.





Source link

Read more...

How to Easily Add JavaScript in WordPress Pages or Posts (3 Methods)


Do you want to add a JavaScript in your WordPress pages or posts? Sometimes you may need to add a JavaScript code to the entire website or into specific pages. By default, WordPress does not let you add code directly in your posts. In this article, we will show you how to easily add JavaScript in WordPress pages or posts.

How to easily add JavaScript in WordPress posts and pages

What is JavaScript?

JavaScript is a programming language that runs not on your server but on the user’s browser. This client-side programming allows developers to do a lot of cool things without slowing down your website.

If you want to embed a video player, add a calculator, or some other third-party service, then you will be often asked to copy and paste a JavaScript code snippet into your website.

A typical JavaScript code snippet may look like this:


<script type="text/javascript"> 

// Some JavaScript code

</script>

<!-- Another Example: --!>  

<script type="text/javascript" src="http://www.wpbeginner.com/path/to/some-script.js"></script>


Now, if you add a javascript code snippet to a WordPress post or page, then it will be deleted by WordPress when you try to save it.

That being said, let’s see how you can easily add JavaScript in WordPress pages or posts without breaking your website.

Method 1. Add JavaScript Site-Wide Using Insert Headers and Footers

Sometimes you will be asked to copy and paste a JavaScript code snippet into your website to add a third-party tool. These scripts usually go to the head section or at the bottom before the </body> tag of your website. This way the code is loaded on every page view.

For example, Google Analytics installation code needs to be present on every page of your website, so it can track your website visitors.

You can add such code to your WordPress theme’s header.php or footer.php files. However, these changes will be overwritten when you update or change your theme.

That’s why we recommend using a plugin to load javascript on your site.

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. You will see two boxes, one for the header and the other for the footer section.

Insert Headers and Footers plugin settings

You can now paste the JavaScript code you copied to one of these boxes and then click on the save button.

Insert Headers and Footers plugin will now automatically load the code you added on every page of your website.

Method 2. Adding JavaScript Code Manually Using Code

This method requires you to add code to your WordPress files. If you haven’t done this before, then please see our guide on how to copy and paste code in WordPress.

First, let’s take a look at how to add code to your WordPress site’s header. You will need to add the following code to your theme’s functions.php file or a site-specific plugin.


function wpb_hook_javascript() {
    ?>
        <script>
          // your javscript code goes
        </script>
    <?php
}
add_action('wp_head', 'wpb_hook_javascript');

Adding JavaScript to a Specific WordPress Post or Page Using Code

Let’s suppose you only want to load this javascript on a specific WordPress post. To do that, you will need to add conditional logic to the code. Take a look at the following example:



function wpb_hook_javascript() {
  if (is_single ('16')) { 
    ?>
        <script type="text/javascript">
          // your javscript code goes here
        </script>
    <?php
  }
}
add_action('wp_head', 'wpb_hook_javascript');


If you take a closer look at the code above, you will see that we have wrapped javascript code around conditional logic to match a specific post ID. You can use this by replacing 16 with your own post ID.

Now, this code would work for any post type except for pages. Let’s take a look at another example except this one will check for a specific page ID before adding the javascript code to the head section.


function wpb_hook_javascript() {
  if (is_page ('10')) { 
    ?>
        <script type="text/javascript">
          // your javscript code goes here
        </script>
    <?php
  }
}
add_action('wp_head', 'wpb_hook_javascript');

Instead of is_single, we are now using is_page to check for page ID.

We can use the same code with slight modification to add javascript code to your site’s footer. Take a look at the following example.


function wpb_hook_javascript_footer() {
    ?>
        <script>
          // your javscript code goes
        </script>
    <?php
}
add_action('wp_footer', 'wpb_hook_javascript_footer');

Instead of hooking our function to wp_head, we have now hooked it to wp_footer. You can also use it with conditional tags to add Javascript to specific posts or pages.

Method 3. Adding Javascript Code Inside Posts or Pages Using Plugin

This method will allow you to add code anywhere inside your WordPress posts and pages. You will also be able to select where in the content you want to embed the javascript code.

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

Upon activation, you need to edit the post or page where you want to add the javascript. On the post edit page, click on the ‘Screen Options‘ button and check the ‘Custom Fields’ option.

Show custom fields meta box

Now scroll down and below the post editor, you will see the ‘Custom Fields’ metabox where you need to click on the ‘Enter new’ link.

Add a new custom field

The custom field name and value fields will now appear.

You need to provide a name for the custom field with a CODE prefix (for example, CODEmyjscode) and then paste the javascript code in the value field.

Adding a JavaScript code to a custom field

Don’t forget to click on the ‘Add Custom Field’ button to save your custom field.

Now you can use this custom field to embed the JavaScript code anywhere in this post or page. Simply add this embed code anywhere in your post content.

{{CODEmyjscode}}

You can now save your post or page and view your site. You will be able to see the javascript code by using the Inspect tool or by viewing the page source.

Tip: These methods are for beginners and website owners. If you are learning WordPress theme or plugin development, then you need to properly enqueue JavaScript and stylesheets to your projects.

We hope this article helped you learn how to easily add JavaScript in WordPress pages or posts. You may also want to see our list of extremely useful tricks for the WordPress functions file.

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

Read more...