Using WP_Query properties instead of an iterator

Screenshot of complex WordPress post loop

Sometimes, when running through a post loop, theme authors need to do something special, depending on the current post in the loop or the total post count. For example, displaying ad space between the first and second post. Or, as in the screenshot above, displaying posts with drastically different markup and output.

This tutorial will cover the basics of using some of the WP_Query properties to handle this.

The common method

One of the techniques I often see is the use of the $i iterator, which is common in programming. Here’s an example:

<?php $loop = new WP_Query(); ?>

<?php $i = 0; ?>

<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>

        <?php if ( 1 === $i ) :?>

                <!-- Output something -->

        <?php endif; ?>

        <?php ++$i; ?>

<?php endwhile; ?>

Core WordPress already has you covered. $i isn’t necessary.

Using the post count

WP_Query objects keep track of the current post in the loop. This is the current_post property. The thing to keep in mind is that the first post will be 0. This shouldn’t come as a surprise to anyone familiar with how loops work though.

Here’s an example of the earlier code rewritten to use current_post.

<?php $loop = new WP_Query(); ?>

<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>

        <?php if ( 1 === $loop->current_post ) :?>

                <!-- Output something -->

        <?php endif; ?>

<?php endwhile; ?>

Getting more complex

In the screenshot at the top of this post, you’ll see that I have two sections:

  • A single post displaying the title, image, and excerpt.
  • A list of 5 posts next to it.

This is all done with a single query. However, the markup needed to change drastically after the first post.

<?php $loop = new WP_Query(); ?>

<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>

    <?php if ( 0 == $loop->current_post ) : // If first post, show title, excerpt, and image. ?>

        <div class="post">

            <h3 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>

            <?php the_post_thumbnail(); ?>

            <div class="entry-summary">
                <?php the_excerpt(); ?>


    <?php else : // If not the first post, add the entry titles as list items. ?>

        <?php if ( 1 == $loop->current_post ) : ?>
            <ul class="post-list">
        <?php endif; ?>

            <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
            <time <?php hybrid_attr( 'entry-published' ); ?>><?php echo get_the_date(); ?></time>

    <?php endif; ?>

<?php endwhile; ?>

<?php if ( 1 < $loop->post_count ) : ?>
<?php endif; ?>

I used post_count there at the end to check the total post count. If it was greater than 1 (the number needed before making the list), I output the closing </ul>.

More cool things

There are probably even more advanced examples that people can do. I just wanted to share the basic foundation you can use to cut back on a little code.

Also, the main query variable is global $wp_query if you want to play around with it. If you’re ever looking for wild afternoon, var_dump() that on a page.

The post Using WP_Query properties instead of an iterator appeared first on Justin Tadlock.

We’ve created the fastest related posts ever

When we say “related posts for WordPress“, we say “bad performance”. Without using an external service like ElasticSearch, it’s practically impossible to have related posts work fast in WordPress. That’s why we’ve always stayed away from including any related posts plugin on our site. It’s also the reason we haven’t tried to come up with a solution ourselves before. In the upcoming release of Yoast SEO Premium, this will change. We found a way to have blazing fast related posts! Let me explain how we did that.

The fastest related posts ever

Our solution has a frontend and an admin component. Let me start by asking a very simple question:

On a content page, what would be the fastest implementation of related posts you could think of?

The (somewhat dull) answer:

Simple, old-fashioned links.

You simply don’t need to generate related posts, if you already link to your related content in your text. Not only is this better for frontend performance, it also benefits SEO. It’s simply better to link directly to your related content in a meaningful context, than to use a generic related posts box somewhere else on your page.

Of course this is easier said than done. The real problem related posts widgets solve is that you no longer have to think about related content yourself. So yes, we still need an algorithm to suggest related content, we just don’t need it on the frontend. Instead, we need to bring this functionality to the editor. This way, we can suggest the writer of an article which related posts he/she might want to link to in their text. We call these *internal linking suggestions*.

Why suggesting related content is costly

So, I guess we haven’t gotten rid of the problem of generating related content in a performant way. The thing we can’t seem to get around, is that we’ll have to do one, or more, very heavy queries to the database at some point. To suggest related links, we need to compare the content of one post with that of all the other posts on our site. The WordPress database isn’t optimized for such queries though. To do this in one operation is costly, and in case your site has a lot of content, that may slow things down substantially.

Optimize your site for search & social media and keep it optimized with Yoast SEO Premium »

Yoast SEO for WordPress pluginBuy now » Info

Indexing content, one post at a time

About a year ago, we moved our content analysis from the server side to the browser. This had a lot of advantages, but a slight inconvenience was that we could no longer calculate the SEO score for a post on the server. This calculation now has to be done in the browser for each post separately. This way we’ve already managed to dramatically improve server side performance with regard to our content analysis tool. When we started thinking about our prominent words algorithm, we realized this would also allow us to easily index content. Saving the most prominent words of every post to the server would make it very easy and cheap to query related content.

Continuous improvement

By leveraging our content analysis tool and utilizing the processing power of the browser to index content, one post at a time, we’ve managed to drastically reduce the heaviness of the queries needed to find related content. Now, we haven’t run any benchmarks yet, but it’s clear that this solution is much faster and easier to scale, without taking any serious performance hits.

In Yoast SEO Premium 4.0 – launching soon! – we’re shipping the first version of our internal linking suggestions tool. We’ll continue tweaking the algorithm to make sure our internal linking tool is the best and most performant related content tool available for WordPress.

Read more: ‘Related posts need to make sense, not just be there’ »

State of the Word 2016: Mullenweg Pushes Calypso as Future of WordPress’ Interface, Proposes Major Changes to Release Cycle

photo credit: WordCamp US organizing team
photo credit: WordCamp US organizing team

Philadelphia welcomed 1,923 attendees to WordCamp US this weekend with an additional 2,028 enthusiasts watching via live stream. Matt Mullenweg delivered his 11th annual State of the Word address to a rapt audience ready to celebrate WordPress’ progress over the past year and hear the project leader’s vision for 2017.

He began by thanking sponsors and volunteers who made the event possible by covering the bulk of the $516 actual cost per person. Mullenweg said sponsors cover roughly 85-95% of the cost of WordCamps worldwide. In 2016, the events sold a total 36,000 tickets, with costs subsidized by more than 1,000 sponsors.

Mullenweg said meetups are the leading indicator for WordCamps and these events have had the fastest growth the community has seen in five or six years. More than 62,566 people attended a local meetup in 58 countries and roughly one third of those were new members.

WordPress Foundation to Create WordPress Community Support Subsidiary

In order to better accommodate the extraordinary growth of the global community, the WordPress Foundation will be restructuring its management of WordCamps. In 2016 the Foundation took in an estimated $4.3 million, up from $2.8 million in 2015, with 99.9% of those funds related to WordCamps. Mullenweg announced that the 501c nonprofit will move WordCamps to its own company, WordPress Community Support, forming a PBC (Public Benefit Corporation) that is fully owned by the Foundation.

He explained that if certain things happened at WordCamps it could endanger the overall Foundation, so WordCamps will now be managed under their own entity where the events will have a little more flexibility in how they do things. The Foundation plans to support some like-minded nonprofits that are aligned with the overall education mission of the organization, including Hack the Hood, Internet Archive, and Black Girls Code. In 2017 the Foundation will also begin promoting hackathons to help nonprofits and NGO’s.

Internationalization is Driving an Increase in Plugin Usage

Mullenweg shared a few stats about the plugin directory, which will soon be launching a new design with revamped search functionality. This year has seen a 20% increase in active plugin usage and a 34% increase in plugin downloads totaling 1.48 billion, which Mullenweg attributed to a spike in internationalization efforts over the past year. The number of translation contributors has grown from 5,000 in April 2015 to 17,000 as of November 2016.

This year there were 1,598 plugins with language packs (up from 314 last year) and 1224 themes with language packs (up from 641 last year). Mullenweg noted that 2/3 of the world speaks one of 12 languages with native fluency and that WordPress covers all of these and many more. In fact, the 4.6 release shipped with support for 50 available languages. WordPress’ top 10 plugins are now 82% complete in the top 12 languages.

Mullenweg Continues to Push Calypso as the Future of the WordPress Interface

During the 2015 State of the Word, Mullenweg gave attendees a homework assignment to “learn JavaScript deeply” and promised to submit a JavaScript patch before 4.7 came out. He submitted his first pull request to Calypso yesterday, Automattic’s from-scratch rewrite of WP admin using Node and React. users have widely adopted the new interface for publishing. Mullenweg shared statistics showing that 68% of posts went through Calypso since its launch, 17% via mobile, and 15% through the traditional wp-admin. Mobile app and mobile browser usage are also up. “We now need to start thinking about mobile devices as the primary way people are going to interact with WordPress in the future,” Mullenweg said.

From the time it launched, Mullenweg has said that Calypso, or something like it, would be the future of the WordPress interface. He reiterated this in his 2016 address and has committed some of Automattic’s JavaScript developers from the Calypso team to contribute full-time to core.

If Calypso has a chance at becoming a promising replacement for the WordPress admin, its creators will need to broaden its interoperability with the WordPress plugin ecosystem. Mullenweg announced that Calypso is now plugin aware and is open to plugins with over 1M active sites.

The next step on Calypso’s roadmap is to bring in support for Automattic’s plugins – WooCommerce, Akismet, Jetpack, and VaultPress. Mullenweg said the big focus for 2017 is to make plugins Calypso-aware, starting with a handful of the most popular ones before opening it up to all plugins.

“The hope is that Calypso, or something like it, is actually what becomes the interface that drives WordPress,” Mullenweg said. Since no one is currently building anything like Calypso and targeting core, it looks like the technology behind will be driving the evolution of WordPress in 2017.

If Mullenweg’s goal is to make Calypso the primary publishing engine for core WordPress, one of the major challenges will be getting plugin developers on board with building compatibility for what is currently an Automattic product. What are the implications of contributing to greater Calypso adoption? If core brings in the Calypso interface in the future, would Automattic push to include its Reader and other functionality, as it has in the mobile apps? These are questions developers will need to weigh when considering whether to pursue a more application-type experience via the Calypso interface.

WordPress Recommends Hosts Offering PHP 7+ and HTTPS by Default

WordPress core continues to update its recommendations and requirements with the help of hosts who are adopting the latest technologies. The official recommendation for WordPress hosting is now PHP 7 or higher. After switched to be 100% on PHP 7, Mullenweg said the network’s performance doubled and CPU load fell in half. Just 4% of self-hosted sites are on PHP 7, but the new recommendation should help move more hosts towards getting their customers updated.

Beginning in 2017, WordPress will have progressive enhancement for certain features that are only available for encrypted sites. Mullenweg announced that is now tracking HTTPS adoption. So far 11.45% of active WordPress websites are on HTTPS and the project will no longer recommend hosts that do not offer it by default. “We want to bring more of the web to be secure, which is especially important in the post-Snowden era,” he said.

Trying New Things: Major Changes Coming to WordPress’ Core Release Cycle

WordPress 4.7 release lead Helen Hou-Sandí joined Mullenweg on stage to highlight a few of the features and improvements that will be coming in the official release on Tuesday. The release is arguably one of the most exciting and successful updates for WordPress in some time, but Mullenweg has a new strategy for core development in 2017.

“We’re at a junction for WordPress where what got us here wont get us there,” Mullenweg said, after highlighting how the software’s market share has grown from 13.1% to 27.2% in the past five years.

Mullenweg proposed a new structure for WordPress releases where design and user testing will lead the way. “I’m putting back on the ‘product lead’ hat for 2017,” he said. The upcoming year will have no set release schedule. Mullenweg is upending WordPress’ predictable release cycle in favor of tackling some larger items on the to-do list. He said the focus will be on performance and fixes to existing functionality in three main focus areas: WP REST API, the Editor, and the Customizer.

Mullenweg said he is particularly interested in getting first-party usage of the REST API in the admin, in hopes of having it evolve to something the project can use for the next decade. If it doesn’t, he said core will consider bringing it back into a plugin specifically for developers.

Mullenweg said he feels the editor does not represent the core of WordPress publishing, a sentiment that many users agree with. He hopes to steer it toward a more block-based approach that unifies widgets and includes an interface for shortcodes.

Mullenweg’s vision for the Customizer is to see all aspects of WordPress become more instant and provide the same interface and UI affordances as the editor. He announced that Ephox, the company behind TinyMCE, has agreed to work with the project to improve the core editing experience.

Shifting from a time-based release cycle to one that is more project-based is a major departure from WordPress’ previous release philosophy of “Deadlines are not arbitrary.” The project’s philosophy page identifies the practice of delaying releases for one more feature as a “rabbit hole” that has been tested and found to be unpleasant. The new approach to core development makes no guarantee that WordPress will have any releases in 2017.

If the experiment is not a success, the project’s days of frequent and fast iteration may be over for awhile. Mullenweg is willing to risk it in hopes of being able to provide more product-based leadership that will distinguish WordPress from its proprietary competitors.

“I think we’re trying to counter stagnation,” Mullenweg said when asked about the new approach to releases in the Q&A segment. “Even though we’ve had lots of releases, certain parts of WordPress have stagnated and haven’t made the leaps that they could.” He suggested that being part of a feature plugin team will give developers a way to be involved in more active releases and continue to build momentum for eventual inclusion of their projects in core.

Mullenweg plans to identify a tech lead and a design lead and will be working with them as the overall product lead. He envisions that when one area of WordPress gets to the point where the software can ship significant user-facing improvements, a release will be born.

“We’re at the point now where the steps WordPress needs to take are more significant to get the other 73% of the web it doesn’t have yet,” Mullenweg said.

In a return to WordPress’ poetic roots, he concluded by reading a poem called Praise Song for the Day by Elizabeth Alexander.

The video of the State of the Word address will soon be available on WordPress’ new YouTube channel.

How to Properly Setup Google AMP on Your WordPress Site

Do you want to setup Google AMP on your WordPress site? Accelerated mobile pages or AMP is a way to make your website load faster on mobile devices. Fast loading websites offer better user experience and can improve your traffic. In this article, we will show you how to set up Google AMP in WordPress.

Google AMP for WordPress

What is Google AMP?

Google AMP stands for Accelerated Mobile Pages. It is an open source initiative supported by technology companies like Google and Twitter. The goal of the project is to make web content load faster for mobile users.

For many mobile users, reading on the web is often slow. Most content rich pages take several seconds to load despite all efforts taken by site owners to speed up their website.

Accelerated Mobile Pages (AMP) in search and browser view

Accelerated Mobile Pages or AMP uses bare minimal HTML and limited Javascript. This allows the content to be hosted on Google AMP Cache. Google can then serve this cached version to users instantly when they click on your link in the search results.

It is very similar to Facebook Instant Articles. However, Instant Articles are limited only to Facebook’s platform, more specifically to their mobile app.

Accelerated Mobile Pages are platform-agnostic and can be used by any app, browser, or web viewer. Currently it is used by Google, Twitter, LinkedIn, Reddit, and others.

Pros and Cons of Google AMP (Accelerated Mobile Pages)

SEO experts claim that Accelerated Mobile Pages will help you rank higher in Google, and it improves the user experience for mobile users on slow internet connections. However, they are several challenges for website owners, bloggers, and marketers.

AMP uses limited set of HTML, JavaScript, and CSS. This means you cannot add certain widgets and features to your mobile AMP website. This limits your ability to add smart email optin forms, facebook like boxes, and other dynamic scripts.

While Google AMP supports Google Analytics, it does not support many other analytics platforms. Same goes for advertising options which are limited to select few advertising platforms.

Despite its limitations, Google is pushing AMP pages by giving them a boost in mobile search.

If significant chunk of your traffic comes from mobile searches, then you may benefit from adding AMP support to improve and maintain your SEO.

Note: There have been a few complaints about Google AMP by bloggers.

First is by Alex Kras who claim that you can potentially lose mobile traffic if you enable Google AMP. Read the article thoroughly because that’s a huge problem, and despite what the Google Tech Lead for AMP project has said, there aren’t any good solutions that address the issue in our opinion.

Second is by Terrence Eden which highlights the difficulties of switching back from Google AMP should you change your mind in the future. We don’t believe this is a major issue because you can do a 301 redirect which several have pointed out in the comment section of his blog posts, but nonetheless it is something you need to think about.

For the reasons above, we are not switching WPBeginner to Google AMP just yet.

However since several of our readers asked about how to setup Google AMP in WordPress, we have created a step by step process on how to setup Accelerated Mobile Pages in WordPress.

Setting up Accelerated Mobile Pages or AMP in WordPress

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

Upon activation, you can head over to Appearance » AMP page to see how your site looks on mobile devices using AMP.

Settings page for WordPress AMP plugin

You can change the header background and text color on this page. The header background color you choose will also be used for links.

The plugin will also use your site’s icon or logo if your theme supports it. See our guide on how to add a favicon or site icon in WordPress for detailed instructions.

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

You can now visit any single post on your website and add /amp/ at the end of the URL. Like this:

This will show you a stripped down AMP version of the same post.

AMP mobile preview

If you view the source code of the original post, you will find this line in the HTML:

<link rel="amphtml" href="" />

This line tells search engines and other AMP consuming apps/services where to look for the AMP version of the page.


If you see a 404 error when trying to view the amp version, then here is what you need to do.

Visit Settings » Permalinks page in your WordPress admin and click on the ‘Save Changes’ button. Remember, don’t change anything here, just press the save button. This will refresh your website’s permalink structure.

View Accelerated Mobile Pages in Google Search Console

Want to know how your Accelerated Mobile Pages are doing in Google Search? You can easily check this using the Google Search Console.

Log in to your Google Search Console dashboard and then click on Search Appearance » Accelerated Mobile Pages.

Accelerated mobile pages in Google Search Console

Don’t worry if you don’t see your AMP results right away. It may take a while for Google to index your Accelerated Mobile Pages and then show data in Search Console.

Extending and Customizing Your Accelerated Mobile Pages

The AMP plugin for WordPress comes with very limited customization options. However you can use some other WordPress plugins to add few more customizations.

If you are already using Yoast SEO, then you need to install and activate the Glue for Yoast SEO & AMP.

It is an add-on plugin for Yoast SEO and AMP plugins. Upon activation, you need to visit SEO » AMP page to configure plugin settings.

Yoast SEO AMP Addon

The plugin allows you to enable AMP support for other post types.

On the design tab, you can choose colors and design options. You can also upload a logo and a default header image which will be used when a post does not have its own featured image.

Design tab for AMP using Yoast AMP addon

You can switch to the Analytics tab to add your Google Analytics ID.

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

There are many more plugins which will allow you to add related posts, footer widgets, and even social media icons to your AMP pages.

However, you need to make sure to validate your AMP pages after you install any addon plugins.

We hope this article, helped you learn how to set up Accelerated Mobile Pages (AMP) on WordPress. You may also want to see our list of 19 actionable tips to drive traffic to your 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 Properly Setup Google AMP on Your WordPress Site appeared first on WPBeginner.

WordPress Will Only Recommend Hosting Companies Offering SSL by Default in 2017

In October, Let’s Encrypt was managing more than 10 million active SSL certificates. That number doubled to 20 million in November as large  providers continue to partner with the organization to manage their customers’ certificates.

In 2014, Google announced that HTTPS is a ranking factor. Earlier this year, the Google Chrome security team announced that Chrome 56 will mark HTTP sites that transmit passwords or credit cards as insecure.


In 2017, managed WordPress hosting companies will have one more reason to enable SSL by default for new accounts. In a post on the blog, Matt Mullenweg, co-founder of the open source WordPress project, explains what the project is going to do to encourage HTTPS by default across the web.

“Early in 2017, we will only promote hosting partners that provide a SSL certificate by default in their accounts,” Mullenweg said.

“Later we will begin to assess which features, such as API authentication, would benefit the most from SSL and make them only enabled when SSL is there.”

Unrelated to SSL, Mullenweg also commented on the significant performance improvements in PHP7 and will consider whether hosting partners use PHP7 by default for new accounts in 2017.

These moves are a continued effort by Mullenweg to secure and encrypt as much of the web as possible. Earlier this year, encrypted all of its sites using Let’s Encrypt.

Let’s Encrypt is an initiative which aims to encrypt 100% of the web by making trusted certificates available to everyone at no cost. It’s a 501(c)(3) nonprofit and recently launched a crowdfunding campaign to cover the cost of one month of operations totaling $200K.

Josh Aas, ISRG Executive Director, explains the reasons behind the crowdfunding campaign, “First, there is a gap between the funds we’ve raised and what we need for next year,” Aas said.

“Second, we believe individual supporters from our community can come to represent a significant diversification of our annual revenue sources, in addition to corporate sponsorship and grants.”

To learn more about the campaign and to contribute, visit Let’s Encrypt’s Indiegogo page.

Let us care for your site: Yoast SEO Care

As a hard-working site owner, it is often difficult to find the time to work on issues that are holding your company back. You might find that the blog posts of your competitor appear higher in search results, but you don’t know what to do about it. Or, you might discover that your site isn’t performing as well as you’d like, even after you’ve tried everything in your power.

For most people, time and lack of knowledge are the factors that limit their success. That’s why we’ve developed Yoast SEO Care. We take the most important technical tasks out of your hands and put them into the trusted hands of seasoned SEO professionals.

Let our SEO experts analyze and improve your site's SEO! »

Yoast SEO Care$ 199 - Buy now » Info

You’ve tried it all

It’s hard to figure out where something is going wrong. But, it’s even harder to discover where to make little changes that can have a dramatically positive effect on your results. You’ve tried to read up on SEO related subjects, but the information is scattered, outdated or just plain wrong. It’s difficult to cut through the bull to get to the real, actionable knowledge. Nobody has time for this, except for us: it’s our job.

What do I get out of it?

You’ve worked hard to build your business. Countless hours to make it grow, year after year. That’s something to be proud of. It takes a lot of effort to become successful. Your site is a crucial part of your business and therefore needs special attention. If you can’t find the time to work on it, or if you fear the technological side, then you need outside help.

By calling in Team Yoast, you’ll get back the freedom to work on other aspects of your business. The experts at Yoast have your back on the technical side of things. We have checked countless sites from clients big and small, from the little artisan bakery around the corner to some of the world’s leading online magazines. Not everyone can call Disney, NASA and their customers.

In addition to that, we know what it’s like to help people make their website better. Currently, the Yoast SEO plugin runs on more than five million sites. For years, Yoast has been helping people to get the most out of their sites and making SEO available for everyone.

This is what we do

Our experts check your site on more than 300 points. We can’t list every one on this page, but here are a couple of important focus points:

  • Technical SEO: are technical issues holding you back?
  • How does your content perform? And how to make it better?
  • Site speed: a slow site is inexcusable
  • Plus, we’ll install and configure Yoast SEO Premium

The extensive, monthly Yoast SEO Care package has even more checks, for instance:

  • Site structure: is your site and content structure correct?
  • Broken pages: customers must never stumble upon these
  • Mobile: how does your site function on mobile phones?
  • Site security: a secure site is a must-have

What you can expect

Besides the comforting feeling that a world-class SEO company is looking out for your painstakingly built site? A personal SEO expert will regularly check your site. He or she will fix issues, make enhancements and give you easy to understand advice that you can use to make your work even better. Following the check-up, your site is in perfect condition to take on any competition you might have.

Let our SEO experts analyze and improve your site's SEO! »

Yoast SEO Care$ 199 - Buy now » Info

Let’s get down to brass tacks

There are two Yoast SEO Care packages. Yoast SEO Basic Care is for site-owners who want a bit of guidance in their work. You still have to put in some work yourself. That’s fine if you have an understanding of SEO, but just need a little nudge. The monthly SEO Care packages gives our experts much more time to invest in your site, making it better in every possible way.

Yoast SEO Basic Care

  • Price: $249 per quarter
  • Quarterly checks (4)
  • Basic checks
    • Technical SEO
    • Content
    • Indexability
    • Site speed
  • Free Yoast SEO Premium license, plus installation

Yoast SEO Care

  • Price: $199 per month
  • Monthly checks (12)
  • All basic checks, plus extended checks
    • Security
    • Site structure
    • Keywords
    • Mobile
    • Duplicate content
    • UX & conversion
    • Meta data

All these checks will be done by a Yoast expert, who will also fix issues, if any, and improve the site in general. You will also receive updates on the progress of your site, plus actionable advice that you can easily implement yourself. In the end, your site is ready to outrank and outperform your competitors!

Ready to make your site a runaway success?

Do you lack the time and skills to take your site or business to the next level? Are you often banging your head on your desk in search of the right answer to a technical challenge? Do your competitors perform better and you can’t figure out how to beat them? Yoast SEO Care can help! Call in Team Yoast and be prepared for more traffic and more sales.

Reviewer Handbook

Sneaking this in just before WordCamp US, if you’ve seen the redesign of this make site, then you may have seen the link to the handbook.

This is a rough draft – it’s not perfect and it doesn’t cover all contingencies. However, yes, that is indeed our handbook. It’s built to the new directory, which we’re not fully using yet, and it has some information that may surprise you. For example, did you know we could see every IP address you’ve ever used to submit a plugin?

On Contributor Day, I’ll be asking victims– volunteers to help with it, to explain things more clearly, and to make this something that can be used to (eventually) include more reviewers.

Speaking of, before you ask for the status, here it is: Not yet.

Once the new directory is live, and once the existing reviewers have worked out the best flow, then we will bring in some existing developers to join us. But it’s not going to suddenly be a flood gate. We’re trying to avoid hitting a backlog as bad as the theme team has, and I’ve been closely watching how they handle reviews and trying to see what we can do to navigate that kind of a delay. Obviously ‘more reviewers!’ isn’t the only answer, and right now I feel that the right fix for plugins is a more streamlined system. I have a plan. I’m sure it won’t last the first day against the enemy (i.e. plugins).

See you all soon at WordCamp US!

#notice #handbook

How to Add Post Type Archive in WordPress Navigation Menus

Recently, one of our readers asked if it was possible to add a link to custom post type archive pages in WordPress navigation menus. An archive page in WordPress displays a list of all posts under a specific post type, category, or tag. In this article, we will show you how to add post type archive in WordPress navigation menus.

How to add custom post type archive link in navigation menus

Custom Post Type Archives in WordPress

In WordPress, the term ‘Archives’ is used for a list of entries from a post type or taxonomy (like categories and tags).

If archives are enabled for a custom post type, then you can display them on your website. Typically, the URL of your custom post type archive page is in this format:

Post type slug is the nice name for your custom post type.

For example, we have a custom post type called ‘Deals’, and you can view its archive page at a URL like this:

You can place a link to the archive page of your custom post type in your site’s navigation menus. This will allow your users to see all past entries posted in that post type on a single page.

Having said that, let’s see how to add a link to your custom post type archive page in WordPress navigation menus.

Adding Link to Custom Post Type Archive page in Navigation Menus

First, you need to visit Appearance » Menus page. You will notice a tab for each of your custom post type in the left column.

Custom post type tab on navigation menus screen in WordPress

You need to click on the name of your custom post type to expand it and then click on the ‘View all’ tab.

You will see an option for your post type archives. Check the box next to it and then click on the Add to Menu button.

Your custom post type archive will now appear as a menu item in the right column.

Post type archive menu item

By default, it will use your custom post type name with the word archives for the link label.

You may want to change this into something easier. Click on the menu item to edit it and then change its navigation label.

Menu label

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

You can now visit your website to see the custom post type archive link in your navigation menu.

Custom post type link in WordPress navigation menu

Just like posts and pages, you can also add a single entry from your post type to navigation menus.

Simply select an entry and then click on add to menu button.

Adding single items from a post type to navigation menus

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

My Custom Post Type Doesn’t Appear on Menus Screen

Custom post types need to match some requirements in order to be displayed on Appearance » Menus page.

First you need to make sure that an archive page exists for your custom post type. Typically it is a URL like this:

Replace with your own domain name and movies with your post type.

If you can see entries from your post type on this page, then this means your post type supports archives but does not support other requirements.

Good news is that you can still add your custom post type archive page as a custom link.

Visit Appearance » Menus page and then click on the ‘Custom Link’ tab to expand it.

Adding a post type archive link as a custom link

Enter the URL of your custom post type archive page in the URL field and add the label you want to display in the link field.

Next, click on the add to menu button, and you will notice the custom link appear in the right column.

Custom link item in navigation menu

You can now click on the save menu button to store your changes.

We hope this article helped you learn how to add post type archive in WordPress navigation menus. You may also want to see our list of 12 most useful WordPress custom post types tutorials.

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 Post Type Archive in WordPress Navigation Menus appeared first on WPBeginner.

Misconceptions by Clients Looking for a Web Platform

Recently we had an inquiry by a customer for a classifieds website. The customer pitched a good number of agencies and independent providers for quotes, looking for the best and most affordable solution that would scale well and be as stable as it gets.

Escalating issues isn't for everyone.
Escalating issues isn’t for everyone.

While WordPress is mostly promoted as a platform for blogging and small business websites (due to the massive marketing worldwide mainly in that direction), we do specialize in high-end solutions such as Software as a Service platforms, large membership websites, media networks and the like – some getting over 10,000,000 page views a month, or handling thousands of subsites in a Multisite environment. Scalability is totally doable within the WordPress context, but the general perception of WordPress is that it won’t handle a real production project for a successful business.

That said, a good number of companies we are talking to pick enterprise-grade platforms that offer less than WordPress and costs up to 6 figures a year – simply due to that marketing that we’re all seeing online.

Here are some of the questions or consultant opinions that our prospect shared with us during the process.

A WordPress website won’t scale at 100,000 visitors a month

That should be pretty easy to counter, especially given a popular number of well known websites and news outlets receiving millions or even tens of millions of visitors a month.

Yes, but those websites are news websites or multi-user blogs. WordPress can’t handle a membership site / eCommerce website / any other non-blogging platform

In fact the architecture of WordPress is content-driven, and content isn’t limited to just blog posts.

WordPress provides two types of public-faced content: Posts and Pages. There are several other default post types used for menus, attachment and revisions, but we won’t touch them for the time being.

There are several great APIs for creating custom post types such as Products, Ads, Real Estates, Profiles, Locations, Courses or anything that your site needs that has a title and content, and a number of required fields (text, checkboxes, dropdowns and so on).

The website should be mobile-friendly – can you create a mobile-friendly website in WordPress?

Responsive websites (or the mobile-friendly ones) depend on the presentation layer of a web platform which usually caters to the design considerations and front-end development (building a theme with the required templates). Unlike many other platforms, WordPress has almost zero constraints when it comes to building the markup. Designing anything and tailoring it for any mobile phone, tablet, or another terminal with a display is just a matter of technical implementation, and is not limited by WordPress in any manner.

Regular WordPress updates are dangerous for my business and can easily ruin it

WordPress releases 3 major updates a year. Those are functional updates that include additional features and tools, as well as API improvements and simplifications for the dashboard user interface.

We have migrated dozens of WordPress websites through 10-15 major releases without any regressions. Think of upgrading WordPress 2.9 to WordPress 4.4 which runs smoothly with no updates needed.

In addition to that major updates are not mandatory. While some 3rd party plugins (which are completely optional) may officially support only the past 2 major versions, they often work with no issues for older WordPress versions. Plus adhering to the WordPress standards ensures longer lifetime with no needs to update as WordPress focuses on backwards compatibility as a major product decision.

Minor versions are automatically updated – these only cater for security issues here and there which are often hard to exploit, and cause no regressions for existing customers.

Customizations in WordPress are introduced in the theme, which affects the portability and causes regular regressions

Bringing functionality in a WordPress theme is considered a very bad practice, and should be avoided at all times. This only happens with a number of multipurpose premium themes or when working with inexperienced service providers. New features should be built as custom plugins, which normally keep working even if you change the presentation layer (the WordPress theme) at some point of time.

Adding plugins to WordPress causes incompatibilities and breaks down the site

There is no guarantee that different plugins from various authors around the globe will work smoothly with one another. That said, at DevriX we do build custom plugins on a daily basis for customer needs. All of them comply with the WordPress Coding Standards which prevents them to collide with other plugins.

Using established and proven plugins is preferred, and carefully assessing and testing solutions at a staging environment should you choose to add several 3rd party off-the-shelf plugins to your website. Well-coded plugins that solve different problems are not supposed to interfere with one another, when picked carefully.

WordPress is inherently insecure

WordPress, as a platform, is one of the most secure web content management platforms out there. Being open source and used by 27% of the Internet, it’s a common attack target for hackers. That’s why it has been tested continuously by both malicious hackers, and professional security experts who have been hardening it constantly for over 10 years now.

There are best practices for hardening WordPress that should always be implemented in a solution, and failing to comply with these is not a problem of WordPress itself.

Hacked WordPress websites are usually breached due to one of the following reasons:

  • Using a low-cost shared hosting that could be breached through a completely different website on the server – or a loophole in the server itself
  • Poorly chosen passwords or wrongfully assigned privileges are the way to get hacked
  • Using insecure wireless networks may intercept your password
  • Hack through a 3rd party plugin or a large bloated theme may lead to accessing your website, but those are external add-ons that you choose to install yourself, unrelated to the Core itself

Those issues can easily be mitigated by carefully assessing any third-party additions to your website and choosing a reliable VPS or dedicated server provider that has been configured securely, and complying with a legitimate security policy for your passwords and access control, just as with every other website out there.

There have been other attacks against WordPress from the same prospect, as well as dozens of other leads who don’t have in-depth experience with WordPress. Naturally, this harms the business market and often discards the platform as a viable solution for enterprise or large business needs.

As seen in DX Summit, WordPress ranks as a lower end platform when compared to Drupal, Crafter, epicore or Typo3 in the higher-end market, as well as sitecore, Adobe ECM, Sharepoint and others ranked high for the serious business fields:

What were the most challenging or interesting problems that you’ve solved with WordPress?

The post Misconceptions by Clients Looking for a Web Platform appeared first on Mario Peshev on WordPress Development.

Yoast SEO 3.9

It’s high time for a new release of our SEO plugins. Since moving to a two-week release schedule, we’ve fixed more bugs than ever and added some awesome new features. With version 3.9, we are gearing up for the big four-oh. In that last release of this year, we will add something remarkable.

But let’s not get ahead of ourselves. Right now, we’re talking about Yoast SEO 3.9 and the changes and enhancements it brings. So, let’s get right to it, ok?

Yoast SEO 3.9

If you use the free version of Yoast SEO, then the first things you’ll notice are the new banners. These are slightly less annoying, while still informing you of our premium products. Besides that, we’ve moved the reload button for Google Search Console from the header. It is now easier to find and use.

We’ve made it possible for other plugins and themes to add HTML namespaces, via the wpseo_html_namespace filter. By doing so, we’ve also made sure to prevent conflicts with other plugins and themes that also add HTML namespaces.

Yoast SEO 3.9 Premium received the same updates and fixes as the regular one, plus a better title update in the social preview section.

Video SEO 3.9

The Video plugin also received some great updates. We’ve added support for traditional Wistia video URL’s and embed codes. To use this, it is recommended to re-index your video’s. There’s now a fallback for the detail retrieval of private Vimeo video’s, so they will be recognized. The plugin now recognizes //… type URL’s. Force a re-index to use it on existing posts.

Local SEO 3.9

Our Local SEO plugin is undergoing some changes as well. The import function has been overhauled, and there is a new export for Yoast Local SEO locations. You can also find a second address line for business addresses that you can use for room numbers or floors, for instance.

Yoast SEO 4.0

In December, we’ll be releasing version 4.0 of Yoast SEO. This release will come with a genuinely awesome new feature for Premium. We can’t tell you too much about it. However, it is something a lot of you will find extremely valuable. Just a few more weeks…

PDF Image Previews Among the Improvements to Media in WordPress 4.7

Among the many enhancements in WordPress 4.7 are improvements to the media component. Previous to 4.7, users who uploaded files to the media library and changed the title could not search for them by file name. Four years since the ticket was created, users will be able to search for media by filename.

PDFs are easier to preview as the media library will create an image preview of the first page. This image is used throughout the library and media attachment screens.

PDF Preview Images in the WordPress Media Library
PDF Preview Images in the WordPress Media Library

In order to generate the previews, the webhosting server needs to support Imagick, ImageMagick, and Ghostscript. If support is not detected, WordPress will fall back and save the attachment without adding a preview image.

WordPress 4.7 also removes the caption text and the image title fallbacks to generate alternative text. Developers are encouraged to read the detailed notes surrounding PDF previews to ensure compatibility with WordPress 4.7. There’s also a handful of other changes to media that users and developers can read here.

5 Best Image Optimizer Plugins for a Faster WordPress Site

When it comes to website creation, nothing beats WordPress regarding ease-of-use and flexibility.

Be it an online store, a professional business website, or a personal blog, this CMS is packed with everything you need to create a professional looking, visually-appealing site within a day.

However, recklessly overloading your site with fancy graphics can be your undoing. Without proper optimization, a single image can slow your site down and ruin the experience for your audience.

If you can’t keep your website’s loading speed below 3 seconds, then you can say goodbye to roughly 40% of your audience. Furthermore, Google indicates that site loading speed is an important SEO factor because they’re all about user experience.

So not only will a sluggish site hurt your conversions, but you’ll also be positioning yourself for failure by compromising your search rankings.

Don’t fret – there are several easy ways for you to optimize your WordPress site for speed.  This infographic from sums them up quite nicely:


As you can see, one of the easiest ways to speed up your website is to optimize your images. This process can be easily done with the help of plugins that are readily available from the WordPress library.

Without further ado, below are five of the best image optimization plugins you should use:

1. WP Smush

WP Smush is one of the most popular image optimization plugins there is, and it’s not hard to see why. All you need to do is activate the plugin and use the “Bulk Smush” feature to start optimizing your entire media library.


One of the advantages of WP Smush is that the quality of images is largely unaffected despite significant file size reductions. You can also enable automatic compression for future uploads to save time.

2. EWWW Image Optimizer

Just like WP Smush, EWWW Image Optimizer also utilizes lossless compression to reduce the size of images without compromising quality. It also offers bulk optimization features for images that are already in your media library before the plugin was installed.


But don’t let the plugin’s simplicity and straightforwardness fool you. Under the hood, EWWW Image Optimizer has a bunch of settings you can personalize such as optimization levels, format conversion, and WebP support.

3. Imsanity

This plugin may seem a little weird, but Imsanity does its job incredibly well. It quickly and automatically resizes large images to achieve faster loading speeds.

Apart from the basic optimization features, Imsanity also allows you to specify the maximum scale of images according to their use. Header images, for example, may have a different maximum size from the photos within your blog posts.


These configurations can be accessed directly from the plugin’s settings page, which is the only interface it has. Apart from those, it doesn’t overcomplicate the process with extra features such as backups that consume additional storage space.

4. ShortPixel

ShortPixel is another comprehensive plugin that can compress your images and more. Aside from the images themselves, you can also apply compression to thumbnails to maximize loading speed and storage space.


The only downside to using ShortPixel is that you need to register your email address and obtain an API key before you can start. It’ll only take a few moments, but not all webmasters are pleased with having to share their contact information.

5. Imagify Image Optimizer

Imagify also requires you to create an account and surrender your contact information before you can use the plugin’s features. However, it is an image compression plugin you can stick to for the long-term.

Aside from having everything you can ask for in an image optimization plugin, it also has a streamlined user interface that will walk you through every step of the way.


Just be mindful that you can only compress up to 25 megabytes’ worth of images a month with a free account. To unlock unlimited features, you need to upgrade to a paid account through their website.


Designing a website with WordPress is fun – except for the part where you have to optimize for user experience. Using the plugins above, you can take a big leap forward and save a lot of time. With large images out of your way, you can now focus on other things such as content development and on-page SEO.

Why Are You Thankful for WordPress?

Tomorrow is Thanksgiving in the US. It’s a time of reflection and an opportunity to express gratitude for the good things in life. In episode 143 of the KitchensinkWP podcast, host Adam Silver asked his two sons why they’re grateful for WordPress.

“I am thankful for WordPress because it gives you a job for the household that we live in and it makes you happy which also makes me happy and smile,” Parker said. “I am thankful for WordPress because it makes you happy and it makes me happy and it provides a roof over our heads,” Carson said.

Inspired by the episode, Josh Eby created the #Thankful4WP hashtag on Twitter. Here are a few reasons why people are thankful for WordPress.

I’m thankful for WordPress because of the opportunities it has provided me and I’ve met some amazing people because of it. If you’re thankful for WordPress please let us know why in the comments. From all of us at the Tavern, have a safe and enjoyable Thanksgiving.

Gratitude is a currency that we can mint for ourselves, and spend without fear of bankruptcy – Fred De Witt Van Amburgh

WordPress Passes 27% Market Share, Banks on Customizer for Continued Success

photo credit: Luis Llerena
photo credit: Luis Llerena

WordPress now powers 27.1% of all websites on the internet, up from 25% last year. While it may seem that WordPress is neatly adding 2% of the internet every year, its percentage increase fluctuates from year to year and the climb is getting more arduous with more weight to haul.


In January 2015, Mullenweg said the next goal for WordPress was to achieve 50% market share (the majority of websites) and he identified Jetpack as a key factor in preventing WordPress’ decline, a controversial statement delivered at Pressnomics. At that time Automattic was secretly working on Calypso,’s JavaScript-powered interface, but did not unveil the project until November 2015.

It’s difficult to say what effect Calypso has had on WordPress’ market share, as the w3tech’s 27% stat covers mostly self-hosted sites. Following up with him a year later, Mullenweg estimates that less than 10% of those sites are hosted on

“It does look like about a quarter of it is using Jetpack, though, and that has grown since Calypso was released,” he said. “Remember – Calypso is for Jetpack sites as well as”

In a recent interview on WPWeekly, Mullenweg said he is also optimistic that the WooCommerce acquisition and Automattic’s sale and management of the .blog domain extension will contribute “another 5-10% each to that market share.” In fact, there is a team inside Automattic called Team 51 that works on strategies for getting the market share to 51%.

“For getting to 51% and beyond – it’s more than just blogs and more than just websites,” Mullenweg said. “We need to do stores well, we need to do wikis well, we need to do real estate sites well, we need to do restaurants well – all these things that may be outside what you normally think of as a core WP experience.”

In order to provide the best content-creation experience on the market, in any niche, WordPress has some major work to do. The software is in imminent danger of being eclipsed by newer competitors if its core features don’t improve, especially when it comes to customizing a new site. Jetpack cannot single-handedly solve WordPress’ onboarding problem.

WordPress’ Weakest Link Is Also Its Greatest Opportunity

In the past Mullenweg has identified customization as the weakest link in WordPress but also one of its most important areas for improvement, saying, “The Customizer is everything.” During the 2015 State of the Word address he said, “Customization is the single biggest opportunity for improving the WordPress experience.” I asked him if he thinks the necessary improvements to make the software more competitive need to come from core itself or if commercial products could introduce game changers for the customer, the editor, and other problem areas of WordPress.

“I think to have an impact on WordPress’ growth improvements to customization have to happen in core or Calypso/Jetpack, otherwise there isn’t enough reach,” Mullenweg said. “It doesn’t matter how great a commercial product is – being behind a paywall will mean it won’t reach enough people to make a dent in WP’s growth curve.” He outlined how he sees the Customizer as a critical component of WordPress’ future:

I think the needed improvements will only come from a customizer and theme system which is flexible, intuitive, and instantaneous, which might also need to break backwards compatibility, and a post editor which leverages the same language, patterns, interface, and concepts. We need to use and adopt a React / Redux approach to the javascript, like Calypso, and rename or make irrelevant concepts like Menus which are just plain confusing to people.

Customizer improvements have been a focus throughout 2016 and the feature’s small team of contributors have made major strides towards improving the underlying architecture to build upon.

“It’s customization that is the key need here, not necessarily the existing ‘Customizer’ interface that we have today,” Customize component maintainer Weston Ruter said. “The key need WordPress has is to be able to live preview more functionality in WordPress, as Helen tweeted here:”

Selective refresh was added earlier this year in 4.5, giving WordPress the ability to preview elements without full page reloads. This is one way the Customize API addresses that “instantaneous” aspect Mullenweg outlined above.

“The Customize Posts plugin is an effort rebuild the post editor from the ground up with live preview for all changes to post data and postmeta at the foundation,” Ruter said. “It’s a JavaScript-first approach to the post editing experience. No more waiting for a full page reload to save a draft. No more clicking a preview button to load the post in a new window. All of the changes are saved as drafts and previewed live. It’s reusing the TinyMCE editor component.”

WordPress may be looking at front-end editing powered by the Customizer in the not-too-distant future. Ruter and contributors are also working towards using the Customize API to power the next generation of widgets in core, which would use JS for UI and open the door for widgets to be managed via the REST API.

“Changesets, coming in 4.7, is the most far-reaching architectural improvement to the customizer since its inception,” Ruter said. “Changesets allow for live preview functionality to be de-coupled from the current Customizer interface. This architecture allows for live preview to be developed in other contexts, namely on the frontend and in REST API-driven apps and headless sites.” Ruter anticipates the REST API endpoints for managing the changesets to come in 4.8.

The WP JS Widgets project shifts widgets away from their heavy reliance on PHP and creates a JavaScript foundation in the Customizer that allows for any library to be used to build widget controls.

“A control can actually be implemented using any JS technology stack,” Ruter said. “In the JS Widgets plugin I have a demonstration of widget controls in the customizer being built using the customizer Element, Backbone.js, and also React.” The plugin currently implements three core widgets and contributors are working on more.

“It’s somewhat of a ‘Widgets 3.0’ in core, focused on what they would look like in the Customizer first,” Ruter said, “where the widget instance data is stored in a setting, and the control listens to changes to that setting and updates its UI to reflect the changes in the underlying instance data.”

Although this particular project is being built to be JavaScript-library agnostic, Ruter said he thinks there would be value in exploring the use of React/Redux in a “Customizer 2.0” interface:

Taking the Customizer Beyond First Impressions

Ruter said he would have a difficult time proposing to build a client site that depended on the WordPress admin for site management and content authorship.

“A lot of the work we’ve done at XWP for the past few years has been building on the Customizer to provide the editorial experiences that I think are lacking in the WP admin,” Ruter said. “We invest heavily in the customizer because we see it as the best foundation that WordPress has to offer to provide the experiences we want to deliver to our clients.”

If the Customizer is so critical to WordPress’ success, it’s curious that the contributor team remains relatively small and few companies are investing in the feature specifically. XWP invests heavily in Customizer development and a great deal of that is prototype work in the form of feature plugins such as Customize Snapshots, Customize Posts, and a couple other plugin projects.

“I don’t know for sure why more developers across the WordPress community aren’t doing more with the customizer,” said Ruter, who is CTO at the XWP. “It may be in part a perception problem, where it has seemingly been stuck with a negative reputation. Or it could be a technology problem, where the Customizer is vastly different from other areas of WordPress being a JavaScript single-page application.”

When the Customizer was first introduced it included support for ‘option’ and ‘theme_mod,’ followed by widgets and navigation menus a bit down the road. The WordPress community didn’t have a full understanding of the scope and capabilities of the Customizer for addressing some of the project’s chief concerns, including content authorship with live previews. Users simply saw a constrained UI they didn’t like using to customize themes. Most users had no concept of the Customizer providing the architectural underpinnings of other aspects of WordPress.

“Part of the problem is a lack of contributors,” Ruter said. “But even more than that, the biggest problem is one of having a shared vision. When the WP community throws hate on customizer improvements with each new release, it’s somewhat demotivating.

“If the community realized the vision behind and appreciated a full admin experience that had live preview and staging of changes, then that would make a huge difference,” Ruter said. He and contributors find it challenging to articulate the scope and they are considerably short-handed.

“It could be a problem with getting ramped up,” he said. “But that’s been the mandate for the WP community as a whole – to learn JavaScript deeply. I say, why not learn JavaScript deeply by building on the customizer?”

GoDaddy Plans to Invest in Core Customizer Improvements

GoDaddy is a surprising company to emerge over the past couple of years as another key player on WordPress’ road to 50% market share. WordPress product and service companies, along with hosts, are keenly interested in seeing the software continue its market dominance.

“It’s very important to GoDaddy that WP market share increases,” Gabe Mays, head of WordPress products at the GoDaddy, said. “We’re deeply invested in the success of the WordPress community, not only because many of our customers use it, but also because of what it represents.”

Mays reports that approximately 1/3 of all GoDaddy sites and half of all new sites are running on WordPress. With millions of customers using the software, the company took the initiative to create a new onboarding experience specifically for WordPress customers. I asked Mays if GoDaddy is concerned about competitors like Wix and Weebly cutting into the WordPress market share.

“I don’t know if ‘worry’ is the right word, because 1) we know the problem and 2) we’re capable of addressing it,” Mays said. “As a community we either care enough to fix it or we don’t. There are negative consequences associated with the latter that pose an existential threat to the community.”

Mays has been involved with the WordPress community for the past 10 years and is working with GoDaddy to improve the new user experience.

“Part of the issue we’re experiencing now is that WordPress benefitted from such strong product market fit and, subsequently, such high growth that there weren’t the typical feedback mechanisms forcing us to make things like the UX better,” Mays said. “On the other hand, our competitors fought hard and iterated for every basis point of market share they have. We’re like that natural athlete that got to the top with natural talent, but now need to master the basics, get our form right, etc. to stay on top as the game changes.”

GoDaddy’s new onboarding experience is a stab at improving this UX and Mays said the company has significant WordPress core improvements in the works to provide a better first-use experience.

“I’m happy to say we’ll also be contributing these improvements back to core,” he said. “We’re happy to have had Aaron Campbell join us as our first core contributor earlier this year and we’re working on more ways to accelerate our core contribution efforts.”

Mays said GoDaddy is planning to submit core contributions to the Customizer and related core components in the near future but would not disclose any specifics at this time.

“Hosts benefit immensely from WordPress and as hosts we can collectively do a lot more to move WordPress forward,” Mays said. “We want to lead by example here and have big plans for this in 2017.”

WordPress product and service companies are also deeply invested in the software’s success and eager to see its market share grow. Cory Miller, CEO of iThemes, one of WordPress’ earliest theme companies, said growth is one potential sign of WordPress’ health.

“As WordPress has grown, so have we with it,” Miller said. “The opposite of growth is scary — it’s stagnation or decline. Many have predicted that in WordPress for a long time, but it continues to grow and push new limits, like the defiant teenager it is.”

Miller said one of his concerns with competitors in the space is that they have started to cut into the lower or lowest end of the market, “the do-it-yourselfers that many of us count as a key part of our customer base.”

“WordPress is fantastic, and so are all the innovative tools and services around it, from themes, plugins to hosting,” Miller said. “But I’m increasingly seeing the reason why many, on perhaps the bottom end of the market, say, ‘I don’t want to mess with updates, or worrying about security, or pulling 15 separate tools together to do what I need. I just want a simple website, I want everything in one bundle, mostly done for me, and so I’ll just go with SquareSpace or Weebly.'”

Although WordPress provides so much more in terms of community and extensibility when compared to Wix, Weebly, and Squarespace, getting started is the hardest part for new users. This is where tools like Jetpack and GoDaddy’s onboarding experience are useful for giving users what they need to succeed with WordPress.

Even with a strong background in HTML and CSS, customizing a WordPress site can be challenging. Your site will never feel like your home on the web if you struggle to customize it to suit your preferences. The good news is that the WordPress project lead, contributors, hosts, and product companies are working together to improve customization in different, complementary ways in order to ensure the future of the project in an increasingly competitive market.

Visible Edit Shortcuts in WordPress 4.7 Makes Customizing Sites Easier

Earlier this year, Weston Ruter, Customize component maintainer, created an experimental plugin that adds persistent icons to show users which parts of a site can be customized when the customizer preview pane is open. Results of the experiment were merged into WordPress 4.7 and are officially called visible edit shortcuts. The icons visually inform users which elements can be edited in a theme.

The icons appear when the customizer is open and directs users to settings that control an element. For example, clicking the icon next to the site tagline in the image below opens the Site Identity section of the customizer and makes the Tagline field active. Visible shortcuts are an extension of the Shift-click to edit keyboard shortcut that was added in WordPress 3.9.

Visible Edit Shortcut Buttons
Visible Edit Shortcut Buttons

The icon approach was largely inspired by which has a similar feature in its customizer. Nick Halsey, Customize component maintainer, describes in detail the history of the feature and what theme authors need to do to support it.

Unlike many of the theme specific updates in the past where developers can add support by using add_theme_support, supporting visible edit shortcuts is more comprehensive. Theme authors will need to add support for selective refresh, selective refresh for widgets, and selective refresh for menus.

“Edit shortcuts will be enabled by default for all themes, but are contingent on themes supporting selective refresh,” Halsey said. Additionally, a small amount of CSS may be required to properly position the icons.

Adding visual elements that connect parts of a theme to the customizer should take some of the guesswork out of editing themes. Instead of spending time browsing through various customizer panels to edit a part of a site, users can click a button and the right customizer panel will open automatically with the settings you need. This can be especially useful for themes that have a lot of customizer sections.

I tested visible edit shortcuts using the Twenty Seventeen theme in WordPress 4.7 beta 4 and didn’t encounter any issues. The team is strongly encouraging users to test with as many themes as possible. If you use a theme where the shortcut icons are not displayed, please contact the theme author, request that they add support, and refer them to the make core blog post which explains how to do so.

Designing better nested comments

Screenshot of nested comments

I’ve always had a love/hate relationship with nested comments. I like the idea of finding replies to comments without having to scroll up and down the page. I hate how unruly they get when more than two or three levels deep.

In my most recent theme, Extant, and the newest theme I’m building, I’m testing a different design concept.

Most nested comment designs I’ve seen just keep indenting each level farther from the left. This gets messy quick. This new concept is based off how Facebook handles threads, only allowing one indention. Even replies to replies are lined up with the second level. You can get a feel for what I’m talking about in the above screenshot.

This is also far easier to handle on mobile devices where screen space is limited and cannot handle multiple levels of nested comments.

The design aspect

This is going to be different for each theme. Some designs use margin to make comments look nested. Some use padding. How you handle that will ultimately be up to you. I opted for stopping the “indentation” at the second level. You could go higher.

WordPress has some handy “depth” classes, which you can use. These are added to the individual comment wrapper. .depth-1 is added to the first-level comment. .depth-2 is added to the second-level comment. And, so on.

Each outter wrapping element (an <ol> by default) is given the .children class, starting with the second level.

Here’s a quick look at some example code for handling this sort of thing:

.comment-list {
    list-style: none;
    margin:     0 1.5rem;

    .comment-list ol.children {
        list-style:  none;
        margin-left: 0;

           .comment-list .depth-1 > ol.children { margin-left: 1.5rem; }

“In reply to” link

Part of the trouble with not indenting each level is that there’s no way to know which comment a level 3+ comment is in reply to. For that, I wrote a little PHP code to display a link, which you can see in the screenshot at the beginning of this post.

The following is both a function for outputting the link and a function for getting it.

function jt_comment_parent_link( $args = array() ) {

    echo jt_get_comment_parent_link( $args );

function jt_get_comment_parent_link( $args = array() ) {

    $link = '';

    $defaults = array(
        'text'   => '%s', // Defaults to comment author.
        'depth'  => 2,    // At what level should the link show.
        'before' => '',   // String to output before link.
        'after'  => ''    // String to output after link.

    $args = wp_parse_args( $args, $defaults );

    if ( $args['depth'] <= $GLOBALS['comment_depth'] ) {

        $parent = get_comment()->comment_parent;

        if ( 0 < $parent ) {

            $url  = esc_url( get_comment_link( $parent ) );
            $text = sprintf( $args['text'], get_comment_author( $parent ) );

            $link = sprintf( '%s<a class="comment-parent-link" href="%s">%s</a>%s', $args['before'], $url, $text, $args['after'] );

    return $link;

Here’s how you’d use the function to output the link. This would go in whatever function you use to handle your comment callback (see docs on wp_list_comments() if you’ve never written a custom callback).

<?php jt_comment_parent_link(
        'depth'  => 3,
        'text'   => __( 'In reply to %s', 'extant' ),
        'before' => '<div class="comment-parent">',
        'after'  => '</div>'
); ?>

That’s all we need to do to handle this different design for nested comments.

Other ideas?

At this point, I haven’t had enough feedback to determine whether this makes for a good user experience. It’s still in the early testing stages, but I like the idea.

A lot more can be done with it stylistically as well (e.g., colors, smaller avatars, etc.). I just wanted to share how I was handling the nesting aspect of it.

Have you tried anything different with your nested comment designs? I’d like to see how others are tackling this issue.

The post Designing better nested comments appeared first on Justin Tadlock.

SEO basics: What’s a slug and how to optimize it

In SEO, we often talk about creating the right slug for a page. But what is this really? And why should you optimize it? In this post, we’ll explain all you need to know about it.

When you google “what’s a slug”, you’ll find that the definition we’re looking for is “a part of a URL which identifies a particular page on a website in a form readable by users.” It’s the nice part of the URL, which explains the page’s content. In this article, for example, that part of the URL simply is ‘slug’.

WordPress slugs

In WordPress, it’s the editable part of your URL that you can edit when writing a new post. Note that this only works with the right permalink settings. It looks like this:


If you have added more variables to your URL, we’re still talking about just that editable part of the URL to the page, like this:


There’s an additional value at the end of that URL. In this case, that extra variable is used so slugs can be the same without the URL being the same. I think these examples clearly show what the slug we are talking about is.

New to SEO? Learn the Basics of SEO in our Basic SEO course »

Basic SEO training$ 199 - Buy now » Info

Optimizing your slug

What are the things you need to think of when constructing the right slug for your post or page? Let’s go over a number of characteristics you need to take into account:

No stop words

Filter our all the unnecessary words. Filter out “a”, “the” and “and” and similar words. We have written a tad bit more on stop words in our WordPress SEO article. For users of our Yoast SEO plugin: you might have noticed we filter stop words out by default.

Add focus

Don’t just filter out stop words, but really all the words that you don’t need. Make sure the slug still makes sense though. In the case of this post, WordPress automatically creates the slug “what-s-a-slug-and-how-to-optimize-it” (based upon the permalink settings in WordPress), which I manually reduced to “slug”.

There is one thing to keep in mind here. “Slug” as a subject is not likely to get another page on its own on our blog. This informative article will most probably remain the central point for information about slugs on our website. So I can reduce the slug to just “slug” for that reason. If this was an additional post to a main article, it would probably have been something like “optimize-slug” (and I wouldn’t have explained what it is, for that matter). So, do consider the page’s level or position on your website.

Keep it short, but descriptive

The URL of your page is shown in Google search results. Not always, sometimes it’s for instance replaced with breadcrumbs (awesome). When it’s shown, Google highlights the matching words from the search query:


So you need to keep that in mind as well. Next to this, a short slug, right after the domain, will allow Google to show these keywords it in its mobile search result pages as well.

Now go optimize your slug with these three things in mind!

Read more: ‘SEO basics: what does Google do?’ »

WordPress 4.7 Improves Accessibility by Removing Alternative Text Fallbacks

When images are uploaded in WordPress 4.6.1 that have an empty alt text value, WordPress tries to generate one based on the caption text or the image title. If the image title is non descriptive as is common with photos uploaded from digital cameras, the alt text can be meaningless.

In WordPress 4.7, the caption text and the image title fallbacks have been removed. The fallbacks were originally introduced to ensure every image included alternative text. Over time however, this practice has proven to be a poor user experience for people who use screen readers.

Since the fallbacks are removed, users will need to explicitly set a value for the alt text field. According to Joe McGill, the change will not affect content already published but will be the expected behavior in WordPress 4.7 and beyond.

If you’re not sure what text to use to describe an image, check out this article on Webaim. It explains when alt text should be displayed and provides useful tips on how to describe an image.

Post format support for custom post types

When building the Custom Content Portfolio plugin, I needed to add post format support to my portfolio project post type. Generally speaking, this is a pretty easy thing to do. However, I wanted to limit the possible formats to only those that made sense for portfolios.

This tutorial will walk you through the process of what I done to handle that scenario.

Adding post format support

Adding support is as simple as adding one line of code to your supports array when calling register_post_type().


Here’s what that’d look like in the code:

           'supports' => array(

That’s all you need if you want to support all post formats for a custom post type.

Limiting post formats

If, like me, you have a post type in which you want to limit support to only some of the formats, you’ll need to work a little magic. Core WP doesn’t have filter hooks for disabling formats.

The first thing we’ll do is create a function that returns an array of the post formats that our post type supports. I’ve chosen the audio, gallery, image, and video formats.

function jt_get_allowed_project_formats() {

    return array( 'audio', 'gallery', 'image', 'video' );

Because there are no hooks for changing the available formats, we’ll instead work with the “theme support” system by changing the theme-supported formats. We’ll just need to limit it to our post type’s admin screens so that it won’t mess with other post types.

add_action( 'load-post.php',     'jt_post_format_support_filter' );
add_action( 'load-post-new.php', 'jt_post_format_support_filter' );
add_action( 'load-edit.php',     'jt_post_format_support_filter' );

function jt_post_format_support_filter() {

    $screen = get_current_screen();

    // Bail if not on the projects screen.
    if ( empty( $screen->post_type ) ||  $screen->post_type !== 'portfolio_project' )

    // Check if the current theme supports formats.
    if ( current_theme_supports( 'post-formats' ) ) {

        $formats = get_theme_support( 'post-formats' );

        // If we have formats, add theme support for only the allowed formats.
        if ( isset( $formats[0] ) ) {
            $new_formats = array_intersect( $formats[0], jt_get_allowed_project_formats() );

            // Remove post formats support.
            remove_theme_support( 'post-formats' );

            // If the theme supports the allowed formats, add support for them.
            if ( $new_formats )
                add_theme_support( 'post-formats', $new_formats );

    // Filter the default post format.
    add_filter( 'option_default_post_format', 'jt_default_post_format_filter', 95 );

You might notice a filter on the default post format there at the end of that function. The reason for this is because core WP allows the user to select a default format. We’ll need to overwrite that if it’s not one of the approved formats for our post type.

function jt_default_post_format_filter( $format ) {

    return in_array( $format, jt_get_allowed_project_formats() ) ? $format : 'standard';

That’s all there is to it. Now a post type like portfolio projects doesn’t have to support formats like “chat” and “aside” when it doesn’t make sense.

The post Post format support for custom post types appeared first on Justin Tadlock.

How to Improve WordPress Email Deliverability with SendGrid

Do you want to improve email deliverability from your WordPress site? Often web hosting providers don’t have properly configured mail settings, which blocks WordPress from sending emails. In this article, we will show you how to improve WordPress email deliverability with SendGrid.

Improve WordPress Email Deliverability with SendGrid

The Problem with Emails in WordPress

By default, WordPress uses the PHP mail function to send out emails. Many WordPress hosting providers do not have this function configured properly. Some even block it to make sure that their servers aren’t used to send spam.

This becomes problematic for site owners because their WordPress site fails to send some or all emails.

WordPress emails are crucial for resetting passwords, sending notification emails, running an online store, getting contact form notifications, and more. If WordPress can’t send emails, you could get locked out of your site or lose customers by missing out on important notifications.

Having said that, let’s take a look at how to improve WordPress email deliverability with SendGrid (for free).

What is SendGrid?

SendGrid is an email service provider. They offer highly optimized email servers that you can use to send out your emails.

They offer both transactional email service (one-to-one emails like WordPress notices, order receipts, password resets, etc.) and email marketing services.

Like all good email service providers, SendGrid spends significant resources to improve deliverability. This ensures that your WordPress emails land in your users’ inboxes, instead of being marked as spam. This is why companies like Uber, Spotify, Airbnb, Yelp, and thousands of others use SendGrid.

Sending WordPress Emails Using SendGrid

To set up SendGrid to work with your WordPress site, first you’ll need to visit the SendGrid website and sign up for an account.

SendGrid is a paid service, but they also offer a free plan which allows you to send up to 12,000 emails each month. That’s plenty for most small to medium-sized websites.

As your site grows, you can upgrade to their paid plan. It starts at $9.90 per month for up to 40,000 emails. You can scale your pricing based on how many emails you need to send every month, but in our experience the free plan is sufficient for most folks.

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

Upon activation, visit Settings » SendGrid to configure the plugin.


The plugin allows you to connect your WordPress site to SendGrid. You can do that by adding an API key or by using your SendGrid username or password.

We recommend using the API key method because it’s more secure. We will only cover the API method in this tutorial.

Start by visiting your SendGrid account dashboard and then click on Settings » API Keys.

Get API Key for SendGrid

Next, you need to choose how to send mail. You can send it using the SendGrid API, or with SMTP.

The SMTP method requires Swift Mailer support. You can add it by installing and activating the Swift Mailer plugin on your WordPress site.

But you don’t need that. We recommend using the API method, since it’s easier to set up and more secure.

Go back to the Settings » SendGrid page in your WordPress dashboard. Under the Mail Settings heading, you’ll need to provide the sender name, email address, and reply-to address.

Edit mail settings in the SendGrid plugin settings in WordPress

The name can be your website name, and the sending address can be your professional email address.

In other optional settings, you can choose to use email templates from SendGrid website and add their template ID in plugin settings. You can also create and use categories for emails you send through WordPress.

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

That’s all! SendGrid will now replace the default WordPress mail function with SendGrid API, providing more reliable email service.

You can test it by performing any action that generates an email notification from WordPress. For example, you could reset your password, add a new user, or fill out your contact form.

We hope this article helped you improve your WordPress email deliverability with SendGrid. You may also want to see our article on customizing email notifications from 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 Improve WordPress Email Deliverability with SendGrid appeared first on WPBeginner.

A New Way to Search, Preview, and Install Themes in the Customizer Removed From WordPress 4.7

Astute testers may have noticed a new feature in WordPress 4.7 beta 1 that enabled users to search, preview, and install themes from within the customizer. This feature was part of five feature projects related to the customizer that were approved for merge last month. Its goal is to unify the theme browsing and customizing experience.

Customizer Theme Browser Flow
Customizer Theme Browser Flow

It was removed in WordPress 4.7 beta 2. Helen Hou-Sandí, WordPress 4.7 release lead, reverted the change after collecting feedback. Some of the reasons for reverting the feature include:

  • Displaying on mobile devices is broken.
  • Inability to close the feature/filter accordion.
  • Checkmarks are overlayed on top of the search form.
  • The full-screen plus reload experience isn’t polished.

According to Hou-Sandí, there is not enough time left in the development cycle to polish the design and make it sufficient for WordPress 4.7. Nick Halsey, who helps maintain the Customizer component, expressed displeasure with the decision.

“Abruptly deciding to pull something without allowing any opportunity to improve things or even bring it up in a weekly dev chat is ridiculous,” Halsey said.

“Had I been asked to provide patches for outstanding bugs (one of which never even received a ticket), I would have gladly done so sooner – this was my highest priority for core for the past 4 months.”

Halsey goes on to say that the revert is disrespectful and insulting to him and that he is unlikely to further contribute to the project until it is back in trunk. Samuel Sidler, Apollo Team Lead at Automattic, responded to Halsey supporting Hou-Sandí’s decision.

“Making a decision to pull a highly visible feature is hard, but, as you know, it’s ultimately one that the release lead should make as it’s their release and they have the best overall view,” Sidler said.

Weston Ruter, who also helps maintain the Customizer component, asked if the revert could be reversed if patches to outstanding issues were created.

“No – if this were a matter of problems that have defined solutions already then the course of action would not have been a revert,” Hou-Sandí responded. “I know that it would feel better to have something more than ‘my gut and the guts of others say no’, but if there was more definition to the problems then we may not have been in a position where reverting from this release was the only sane thing to do.”

The feature has been punted and the milestone was changed from WordPress 4.7 to a Future Release.

A Window Into How WordPress Development Works

The quotes I published above are only part of the story. I highly encourage you to start with this post and read every response in full. It’s a great opportunity to see a WordPress release lead in action and how and why certain decisions in WordPress development are made. Those interested in the feature’s progress can follow along by monitoring this ticket.

Ask Yoast: importance of using excerpts

Want to know how to create attractive archive pages? And how to increase click-through rates to your posts or pages? Make sure to write short and appealing excerpts for every post or page. The excerpt should be a teaser to get people to read your post. In this Ask Yoast, Joost explains the importance of using excerpts.

This Ask Yoast is all about the following question:

“Why is it important to use the excerpt? Doesn’t Google consider this to be duplicate content?”

Check out the video or read the answer below!

Optimize your site for search & social media and keep it optimized with Yoast SEO Premium »

Yoast SEO for WordPress pluginBuy now » Info

The importance of using an excerpt

“The excerpt is that bit of the post, that will be shown on archive pages. So, if you write a specific excerpt for a post, then that excerpt is what shows on archive pages.”

excerpt input field wordpress

The excerpt input field in WordPress

 “Sometimes it’s also shown on your front page, if the front page of your site features your blog posts. The excerpt can actually be a very good teaser to get people to read your article.”

excerpt on homepage

Blog post excerpt as shown on our homepage

“The excerpt is not considered to be duplicate content. In fact having excerpts for every post prevents having duplicate content, when you have a long archive page which shows more bits of the post. So you should use the excerpt if you can. It’s a bit more work, because that means writing an excerpt for every post. But you should if you could. Good luck!”

Ask Yoast

In the series Ask Yoast we help you with your SEO question! Not sure what’s best for your site’s SEO? We’ll come to the rescue! Just send your question to

Read more: ‘How to create the right metadescription’ »

User Testing the Directory Revamp

Does the directory currently have a kind of ‘meh’ UX? Yes. Yes it does. We know it. We know search is chancy at best, and people (especially developers) get grumbly when they can’t find what they want.

Well. Here’s your chance to step up and help us fix it.

Plugin Directory User Testing – Round 1

The tl;dr here is @mapk had some tasks for he asked people to run through to try and report on. Using that information, we’ll figure out what has to be changed, what’s going to have to be lived with, and what can and cannot be improved.

But it won’t get better without YOUR help.

So if you care about the usability of the Plugin Directory, please help. Speak up and try the tests yourself. Figure out what’s broken and speak up on it. We need to know.

Take the 2016 WordPress User Survey

With WordCamp US a little less than a month away, it’s time to take the 2016 WordPress user survey. The survey is quick and easy to fill out with only a few questions to answer. Results are anonymized and will be shared at this year’s State of the Word presentation.

Results from last year’s survey were not shared during Matt Mullenweg’s State of the Word presentation. During the question and answer portion, Mullenweg was asked about the results.

“Lots of data to go over, but basically more people are using WordPress, app development is growing, lots of people are making their living with WordPress, and other great trends are showing up,” Mullenweg responded. “We’ll try to do a blog post about it.”

A post highlighting the results from the 2015 survey has yet to be published.

In 2014, 33K people took the survey and of those 33K, 7,539 or 25% said they make their living from WordPress. Over 90% of respondents said they built more than one site.

If you use WordPress, please take a few minutes to complete the survey. Also, tickets are still available to attend WordCamp US December 2-4.