How to remove users from WP-JSON

Not everyone knows this, but by default WordPress exposes usernames and makes them available for the public to see over WP’s REST API.

A list all of all is available at users https://example.com/wp-json/wp/v2/users and one can also get information about a specific user at https://example.com/wp-json/wp/v2/users/1, where 1 is a user’s ID.

To disable these two endpoints, add this code snippet to your theme’s functions.php file:

// Disable /users rest routes
add_filter('rest_endpoints', function( $endpoints ) {
    if ( isset( $endpoints['/wp/v2/users'] ) ) {
        unset( $endpoints['/wp/v2/users'] );
    }
    if ( isset( $endpoints['/wp/v2/users/(?P<id>[\d]+)'] ) ) {
        unset( $endpoints['/wp/v2/users/(?P<id>[\d]+)'] );
    }
    return $endpoints;
});

Sustainable hosting – A closer look at the Hamina Google data center

The Hamina Data Center

Google purchased the site in Hamina from the Finnish paper company Stora Enso in 2009 and built the data center at the paper company’s old paper mill. It’s a great irony of our time that the mill, which closed down due to poor profitability caused by a drop in paper production, is now replaced by a data center.

Innovative cooling system

The data center is powered by Finland’s standard grid and has a power agreement (PPA) with a Swedish wind farm to account for its energy consumption. However, what makes the Hamina center stand out, is its innovative cooling system.

Cooling is an important factor for operational reliability in data centers, and over 20 percent of energy consumption is usually attributed to cooling. Google normally uses outside air for cooling, and Hamina has a beneficial climate with an average temperature of 2 degrees celsius. In the Hamina data center, Google also uses an advanced cooling system involving seawater.

The data center is located at the edge of the Baltic Sea. Water is pumped from the sea and transported inside underground granite tunnels, originally built and used by the paper mill, to the data center’s cooling system. The cold water from the sea removes the heat that is generated by the computers and flows from the facility back toward the sea. By the time it reaches the sea, the water temperature has dropped close to the original temperature of the sea.

The reuse of the old paper mill’s infrastructure is part of making the data center as green as possible and an excellent example of how Google is thinking “outside the box”.

Power usage effectiveness (PUE)

The most common metric for a data center’s energy efficiency is power usage effectiveness (PUE) – it’s the ratio of total energy used by a data center, to the energy delivered to the computing equipment. 

The average PUE in the world is 1.57, which means a 57% overhead (non-computing energy like cooling and power conversion). The average PUE for all Google’s data centers is 1.10, and the Hamina center’s PUE is 1.09. 

Low CO2 region

To empower customers to make more sustainable decisions, Google has introduced a Low CO2 label indicating which Google Cloud regions have the lowest carbon impact. These regions have a Google CFE%, representing the average percentage of time an application will run on carbon-free energy, of at least 75%. The Finland region can boast a CFE% of 94%, which is the highest of all Google regions. 

The Hamina data center is one of the most efficient ones in Google’s fleet, and may also be the greenest, and is an excellent example of how to build a data center with minimal impact on the local environment.

Google Cloud is now available in Poland – Use with WordPress

The establishing of a Google Cloud Data center in Poland is lead by a local company called DCP, they also partner with a polish bank. Together with Google they will work towards making the Google Cloud Platform a success in Poland. The data center being put to use now is located in Warsaw.

For the huge amount of people relying on having a fast WordPress website to serve people located in Poland, this is amazing news indeed. If you want your website to be amazing and always have a helping hand at your side, Templ is a perfect choice for you.

If you are planning on launching an e-commerce website targeting polish customers, for example, imagine having the fastest website available among your competitors, wouldn’t that be great? That is very much possible using the Google Cloud Platform when hosting your website.

If you would like to try our service for yourself, you can register for a trial account right now and get our help in migrating your site, if you already have one, or do it yourself if you prefer. After that you will be ready to go, and for 10 days you can experience all of what Templ has to offer you and your objectives.

The value of your website being fast when it comes to a pleasant experience for your visitors is apparent, but it has also become even more important than before, how you may ask? Recently Google officially made page speeds an important factor in how they rank websites. Since having a high ranking on Google can make such a huge difference for businesses, loading speeds has increased in importance. Therefore we recommend choosing your hosting wisely and only settle for a premium solution like Templ.

In summary, a Google Cloud data center has opened in Warsaw and you can now choose the region of Poland when using Google Cloud products. Since we here at Templ are providers of managed WordPress hosting powered by Google Cloud, we are happy to now be able to let our customers host their website in Poland.

Use Google Cloud in Australia for your WordPress website now

For people who run websites, these days, speed is of utmost importance because of changes in the Google algorithm. Simply put, if your website doesn’t have fast hosting and is poorly optimized your Google ranking will be lower than otherwise.

Using Google Cloud servers to host your website is an excellent choice. This is because they offer really fast servers that are secure and reliable. You could set up a server directly on the Google Cloud Platform yourself if you are tech-savvy or you could just use a web host that uses them. At Templ we are exclusively using Google Cloud Servers so our customers can get all the benefits it provides.

We are happy to see a Google Cloud server location in Australia, so that finally the WordPress community in Australia can reap the benefits of the Google Cloud Platform.

When you create a WordPress website with a hosting solution using Google Cloud like Templ you get to choose from the available data centers Google have all over the world, as for Australia, currently they have a data center in Sydney with another data center coming soon to Melbourne as well. If you choose to use Templ as your hosting provider for your WordPress website you can now select Sydney as the location for the website. This is useful for anyone with their main visitor base living in Australia, this will lead to low latency and fast loading speeds for them.

WordPress 5.8 is here – WebP images now supported natively

Today it was time for yet another major release of WordPress, namely WordPress 5.8.

But what exactly is new in this latest release? We’ll take a closer look to find out!

What’s new in WordPress 5.8?

The focus for this update has been to continue moving towards “full site editing” using WP’s block editor, and new for WP 5.8 (among other things) is the block-based widget editor.

When navigating to Appearance -> Widgets, one is now introduced to the familiar block editor interface that lets one add, remove and edit current widgets.

This is certainly one step to make the user experience across WP Admin more consistent and familiar.

Block-style widget editor in WordPress 5.8
WordPress 5.8 now has a block-style editor for widget areas.

The full list of updates and new features in WordPress 5.8 looks like this:

  • Manage Widgets with Blocks
  • Display Posts with New Blocks and Patterns
  • Edit Post Templates
  • Overview of the Page Structure
  • Suggested Patterns for Blocks
  • Style and Colorize Images
  • theme.json
  • Dropping support for IE11
  • Adding support for WebP
  • Adding Additional Block Supports
  • Version 10.7 of the Gutenberg plugin

Native support for WebP images

One of the biggest and most notable features in WordPress 5.8 is the added support for WebP images.

The native support for WebP images that’s introduced allows for uploading of .webp files directly in WP Admin, exactly like one would upload more traditional image files such as JPG, PNG and GIF.

WebP image in WordPress 5.8
WordPress 5.8 adds support for WebP images.

WebP offers much more efficient compression compared to JPG and PNG and can help to reduce the footprint of your website and speed up load times.

Please note however that WebP is not supported in older browser so all your visitors might not be able to see WebP images that you publish.

For a more detailed look at WebP support in WordPress, check out our ultimate guide to WebP images in WordPress.

New features for developers

For developers in general, and theme developers in particular, it’s good to know of the new support for a theme.json file, which allows for easier theming of the block editor.

An example of how to add palette colors using theme.json looks like this:

{
    "version": 1,
    "settings": {
        "color": {
            "palette": [
                {
                    "name": "Black",
                    "slug": "black",
                    "color": "#000000"
                },
                {
                    "name": "White",
                    "slug": "white",
                    "color": "#ffffff"
                }
            ]
        }
    }
}

It sure seems like this will make fully implementing the block editor in one’s theme easier than before. A much welcome addition to WordPress core.

Summary

All in all, this is a solid WordPress update that brings many improvements across the board.

At Templ we are mostly excited about the addition of WebP support however. 🙂

How do you like this new update of WordPress core? What’s your favorite feature? Let us know in the comment section below!