Customizing the Error Page for Deactivated or Archived WordPress Sites

When someone visits a site by default, that means they are deactivated, then they will see a pretty dull default screen, informing that the site has been suspended. However, the problem comes when you want to customize, or add some custom content. Therefore, as a solution, this article will show you the exact way to do that. Below are some of the ways:

Suspending Sites in Your Network – the Options

Many web developers may think that terminology around deleting and suspending sites in a network is very confusing, since it’s not clear what each one means and sometimes when you do one, the system will tell you that you’ve done another.

Below is a recap on the options for removing sites from your network.

Here’s a detail of the Multisite Sites screen, which you access by going to My Sites>Network Admin>Sites:

You can find four options for removing the site:

  • When your users signup for a site, you can deactivate reverse the activation step users. However, it can be reactivated any time, since it doesn’t permanently delete the site. Besides, both the front end and the site admin screens aren’t accessible.
  • It is important to mark a site as being archived to prevent other users from accessing it. The admin screens can be accessed but not the front end. Besides, you can archive a site easily at any time and it hasn’t been removed.
  • Once your site gets spam, your site will be marked as spam, not deleted. To make it available again, you can decide whether to unmark it as spam or delete it.
  • Delete the site, but be careful when deleting the site because you have to make sure that you are ready to delete it.

The Default Screen for Suspended Sites

When your site is removed, WordPress will show a default screen. Below are scenarios that you will see.

Deactivated Sites

Visitors can see a default screen if a site is deactivated and someone other than the (logged in) network admin visits it.

Archived Sites and Sites Marked as spam

You’ll get a different screen notification, when you mark a site as spam or archived.

I know that the screens may be too basic and simple. Therefore there is not much information or explanation about what’s meant by ‘no longer available’ or ‘archived or suspended’.

Creating a Page for Deactivated Sites

Creating a new page for displaying when someone visits a deactivated site is quite straightforward. You simply create a new file called blog-deleted.php and put it in your network’s wp-content folder. This file will then be used to display a custom page instead of the default page.

Note that this is in the network’s wp-content.php folder and so the same file will be used for any sites in your network that are deactivated. In other words, you have to create something generic, rather than something specific to one site in your network.

To avoid your site from using theme or calling any plugins or additional files, the page you create has to stand alone. As a solution, you need to include any styling in that file or call an external stylesheet, which you would put in a styles folder in your wp-content folder.

Remember to include the <head> section and the opening and closing <body> tags as these won’t be coming in via your themes’ header or footer files.

You can try this by using a very simple file with all the styling included in it or with a completely blank file if you’d like or you can copy some of the content from your theme files. For example, use the copied contents of  theme’s header.php file and edit those down significantly, then manually add the rest of the markup.

Here’s the content of  <head> section:

<?php
              // file for displaying an error message on deleted sites
?>
<!DOCTYPE html>
<head>
<meta charset=”<?php bloginfo( ‘charset’ ); ?>” />
<title><?php
              /*
               * Print the <title> tag based on what is being viewed.
               */
              global $page, $paged;
              wp_title( ‘|’, true, ‘right’ );
              // Add the blog name.
              bloginfo( ‘name’ );
?></title>
<style>
              .content {
                             width:500px;
                             height:500px;
                             margin:0 auto;
                             background:#999;
                             position:absolute;
                             left:50%;
                             top:50%;
                             margin-left:-250px;
                             margin-top:-250px;
                             padding: 10px;
              }
              .content p {
                             position: relative;
                             top: 50%;
                             transform: translateY(-50%);
                             text-align: center;
                             font-size: 18px;
                             font-family: ‘Helvetica Neue’, Verdana, sans-serif;
              }
              a:link,
              a:visited {
                             color: #fff;
                             text-decoration: underline;
              }
              a:hover,
              a:active {
                             color: #fff;
                             text-decoration: none;
              }
</style>
</head>

 

You can find some metadata and styling from the example above.

Now for the <body>:

<body <?php body_class(); ?>>
       <section class=”content”>
 
              <?php _e( ‘<p>This blog has been deleted, sorry! To create your own site, please visit <a href=”‘ . network_site_url() . ‘”>The Main Network Site</a>.’, ‘compass’ ); ?>
 
       </section>
</body>

 

The code above is just an element for the content, with a paragraph inside it and some text, which is translatable. If your network allows user sign-ups, you might need to include a link to the main site. If this site has been replaced, you might need to link to a different site or to a page on your main site explaining your policy for deleting sites, or wherever you want.

So, now the result will be like:

Isn’t it pretty? Now, you can add some different styling colors and maybe a headline. Furthermore, it is also possible to replace the default page for deleted sites and add anything you want to.

Creating a Page for Archived Sites

You can also create a custom page for sites which have been archived or marked as spam and you need to create another file also in your wp-content folder. This is called blog-suspended.php. file, but with a slightly different text. Here’s the code:

<?php
              // file for displaying an error message on deleted sites
?>
<!DOCTYPE html>
<head>
<meta charset=”<?php bloginfo( ‘charset’ ); ?>” />
<title><?php
              /*
               * Print the <title> tag based on what is being viewed.
               */
              global $page, $paged;
              wp_title( ‘|’, true, ‘right’ );
              // Add the blog name.
              bloginfo( ‘name’ );
?></title>
<style>
              .content {
                             width:500px;
                             height:500px;
                             margin:0 auto;
                             background:#999;
                             position:absolute;
                             left:50%;
                             top:50%;
                             margin-left:-250px;
                             margin-top:-250px;
                             padding: 10px;
              }
              .content p {
                             position: relative;
                             top: 50%;
                             transform: translateY(-50%);
                             text-align: center;
                             font-size: 18px;
                             font-family: ‘Helvetica Neue’, Verdana, sans-serif;
              }
              a:link,
              a:visited {
                             color: #fff;
                             text-decoration: underline;
              }
              a:hover,
              a:active {
                             color: #fff;
                             text-decoration: none;
              }
</style>
</head>
<body <?php body_class(); ?>>
       <section class=”content”>
 
              <?php _e( ‘<p>This blog has been suspended, sorry! To create your own site, please visit <a href=”‘ . network_site_url() . ‘”>The Main Network Site</a>.’, ‘compass’ ); ?>
 
       </section>
</body>

 

The page below is what you will get when you visit an archived site:

 

By this, our visitor will get more information and a link to the main site which you can replace it with whatever you want.

Hopefully, by following the steps above, you can quickly and easily replace the default pages for archived, suspended or deleted sites. As a result, visitors will get more information from the default screens which will give them a link to your main site. This will prevent users from just leaving your network entirely.

Knowing What’s Missing in WordPress Functionality

WORDPRESS’-MISSING-FUNCTIONALITY-(AND-HOW-TO-FIND-IT)_ywf

WordPress has become one of the most well-known website platforms in the world. Many people love this platform because of its flexibility, security and ranges of plugins that one can install to provide additional functionality. However, with many benefits that it offers, WordPress still lacks with many things. If you are a web developer, the information below can be beneficial for you. Here are a few requests for the missing functionality in WordPress; and some workarounds for the meantime.

Ability to Duplicate Posts

WordPress is equipped with completely redo settings to get the desired output which can be unnecessarily time consuming. This functionality on WordPress is limited to the use of a plugin: Duplicate Post.

With a duplicate post plugin, you can “clone” a post or “create a new draft”. The latter copies the post and opens it in a new window for editing. On the other hand, the former creates a new post entirely.

Moreover, you can also edit settings that let you do things like copying with this plugin:

  • Original date,
  • Original status (saved to draft, published, pending),
  • Original excerpt; original attachments,
  • Children of the original page,
  • Taxonomies/custom fields.

You are also able to work with custom post types in this plugin. Unfortunately, not all plugins are compatible and doesn’t necessarily call out these incompatibilities on the front end. As a result, it can cause worst scenario, such as complication from using this plugin can crash your website, so it is important for you to have a backup.

Bundle Settings and Plugins for New Installs

If you are planning to create multiple sites in WordPress, it would be particularly helpful to have some functionality that combines all the desired features into a file that could be uploaded to the site you’re building. If you work with clients in a similar industry, you will see that many WordPress websites have the same base features. However, installing /activating the launch list plugins one by one is tedious, so as a solution, you can install WordPress Install Profiles plugins. Once installed and activated, Go to Plugins > Bulk Install Profiles.

Furthermore, you can easily add or remove plugins from the list with a default list of plugins. Use the name on the plugin’s URL to add a new plugin, after that, give the list profile a name and download it to your computer.

You’ll need to have the WordPress Install Profiles plugin installed and activated on that site, then import the profile you want to install on another website. However, since this plugin hasn’t been updated in many years, there may be compatibility or security issues associated with its use.

SITE CACHING

Site caching supports your site to load faster by storing the website processes in an HTML file to be loaded as needed. That is why page loading is a major factor for ranking in technical SEO. To avoid any server calls, developers wish that WordPress had site caching.

Even though you cannot find site caching built into the platform, there are many plugins that can initiate this process, like W3 Total Cache and WP Super Cache. Actually, there are some WordPress hosting companies that offer site caching. However, many find that site caching offered through a web host is more efficient than these plugins, so if that’s an option, don’t install a caching plugin.

Built-In Form Builder

You can find a lot of form builder plugins, but since most businesses use forms anyway, why not add this functionality to the WordPress core code? Rather than waiting for this functionality missing in WordPress, try an all-purpose contact form plugin like Contact Form 7. With contact Form 7, you can manage multiple contact forms, and you can easily customize form and email content with simple markup. Besides, Contact Form 7 supports Ajax-powered submitting, CAPTCHA, Akismet spam filtering, and other important security factors. Another benefit that you can get is the simplicity to set-up, flexible, as well as it offers customizable default messages, and easily-defined mail messages.

Improved Theming System

In terms of the theming system, WordPress still needs lots of improvement. There are still “sloppy code” and “disastrous mix of business and display logic”. In the current version, you can see that template hierarchy does not take plugins into account. As a result, the plugin has to override the template system, or create a workaround to provide a default template for displaying this custom post type if you have a plugin with a custom post type for movies.

The more complex the code base, there is a greater opportunity to improve code practices, eliminate short codes, and fix template hierarchy for a more efficient base theme.

Custom User Permissions

In general, WordPress serves its users with 5 roles:

  • Administrator
  • Editor
  • Author
  • Contributor
  • Writer

In terms of managing tasks, each of these roles has their own specific limits. Many developers suggest it, so that WordPress could allow users to set, specify, or limit what each individual user can do, especially for a multi-author/user site.

To overcome this functionality missing, you can use Advanced Access Manager plugin; which manages both frontend and backend access.

File Browsing Interface

Even though you can find various plugins available, you have to be careful in choosing the right plugin for your website, since certain plugins may cause your website to slow down. By having an error code, you can identify this, but when it does not, then you have to manually deactivate all files, and then reactivate them one by one in the admin area to determine what is causing the error. However, you have to use a File Transfer protocol (FTP) like Firezilla to backup all plugin files if the error does not allow access to the admin area.

Besides, developers can quickly fix issues without needing cPanel/FTP access since you can access files directly from WordPress.

Nowadays, WordPress is still the most powerful platform on its own. No wonder there are various plugins that have been developed to support the functionality missing in WordPress, even though many developers are still hoping that the issues will immediately get built-in solutions.

An Excellent Guide to Choosing a WordPress Theme

A-No-Nonsense-Guide-to-Choosing-a-WordPress-Theme_ywf

As a web developer, you will certainly notice that there are more than 10,000 WordPress themes currently. These amounts will confuse you, so you should know how to pick one that is best for you, right. In the following information, you can learn how to select the best theme for you. Therefore, make sure you read all of the following information.

Free Themes – Pros and Cons

Nothing wrong with free themes, they don’t necessarily have any huge disadvantages over paid themes. You don’t have to pay for any advertising on your site or branding. If you find that the free theme can fulfil your need, go for it, you can always upgrade it to premium later.

Pros:

  • Free
  • High security and good quality coding if you choose a free themen from the official WordPress directory
  • Often simple, lightweight, and easy to set up and use.

Cons:

  • Lots of people use the same themes so your site may not look unique
  • Limited customization options
  • Limited support
  • Fewer updated than premium themes

Premium Themes – Pros and Cons

Generally, big sites or company will use premium themes, if you’re setting up a site for your business, you have a blog with a large following that you want to move to WordPress, or if you want to make any kind of income from your site, you might want to think about choosing premium from the start. Moreover, having a premium theme also will give you a unique theme. However, this doesn’t mean that a premium theme is always better than a free theme. You can still find some badly coded and slow to load premium themes out there.

The price of a premium theme varies from just a few dollars to several hundred. Besides, high price doesn’t guarantee the quality. Therefore, you have to be smart in choosing the right features of your theme.

Pros:

  • More features
  • Unique design
  • More frequent updates
  • Advanced customization options
  • Developer support.

Cons:

  • Not always more secure or better coded than free themes
  • Some premium themes are bloated and slow to load
  • Not free
  • Most premium themes ask for a recurring payment to keep receiving support and updates.

After knowing the pros and cons between free and premium theme, now it’s time to choose your WordPress theme design. Here is some guidance for choosing the right theme.

  1. Fit for Purpose

When choosing for a theme, it is not for beauty only, but the main purpose of your site is also important. For example, if your content is mostly text then you’ll want to choose a theme that’s designed for a good reading experience. However, if you want to display more images with a focus on visual content don’t choose an image-heavy design, although it may look pretty.

  1. The Importance of Responsive Design

As so many people are using smart phones and other small screen devices to access the web, it is necessary to use a fully responsive theme. Make sure you’re happy with how the site looks and works on mobile as well as full screen.

  1. Keep it Clean and Simple

To set a style that will be suitable for a long time, you better choose a simple design that can showcase your content. In fact, overly designed themes go out of fashion very quickly.

Instead of focusing on the images, it is also important to look at the layout and spacing of the site. Some themes may look amazing in preview, but when you substitute in your own images, they’re not so impressive.

  1. Theme Features and Plugin Compatibility

Another aspect is to consider the additional functionality of the theme. Many premium themes come with all sorts of bells and whistles, which may or may not be useful for your personal needs. Besides, premium themes tend to have more advanced and extensive features. Some common features of premium themes include:

  • Image or featured posts slider
  • Social sharing icons, menus, and widgets
  • Custom page styles (different layouts for blog, gallery, about, etc.)
  • Mega menus
  • Retina-ready (theme looks crisper and more detailed on HD displays)
  • Custom shortcodes (to easily add buttons, styled links, icons and other design elements to your site posts and pages)
  • Ecommerce features
  • Translation ready

But, be careful when choosing a theme with too many features. You can usually use a separate plugin to do the same job, so never base your choice on features alone.

  1. SEO

We cannot neglect the SEO standards which will make your web easily to be searched for when someone searched for a related term. Therefore, make sure that your site is marked up properly with meaning using the correct code for page headings, image descriptions, etc.) And that it loads quickly. To find theme that is SEO friendly, you can do your own research and read some real reviews from people’s experience.

All the above tips lead you to one thing that you should know which theme that has a good quality and suitable for your needs.