WordPress: Mixed topics


Default admin password

After you freshly installed your WordPress page you have to change that password by login with the password provided by your hosting provider and selecting the menu option [Users] then choosing the [Edit Profile] option on the top right and then clicking on [Set New Password]:

User Management

In WordPress there are 5 types of roles:

RoleDescription
AdministratorHas full right on the website and can manage everything. This user can install plugins, change themes, editor or delete posts, …
EditorHas full right with respect to handling of content. This user cannot install plugins, change themes and those page management tasks but it can change any content, not only content of posts but also pages, comments, tags, … . It can create, edit, delete pages, posts, …  And this user can not only change its own posts by any users posts.
AuthorHas the right to create, edit, delete and also publish its own posts but not other people’s posts.
ContributorHas the same rights like Author but without the right to publish its content or upload content.
SubscriberCan read and comment other users posts and pages.

Getting Infos about WordPress Installation

Finding the PHP Version

Go to menu option [Tools\Site Health]

Select [Info] tab:

Scrolle down and expand the [Server] bar:

WordPress Config file

Many of the configurations of the WordPress Installation are set in the wp-config.php file, which can be found in the root directory of WordPress. Here are some examples of the configuration setting which can be found in this file:

/** The name of the database for WordPress */
define( ‘DB_NAME’, ‘name_of_db_used_for_wordpress’ );

WordPress Backup & Restore

Overview

Backing up a WordPress site consists of two parts:

  • Files which contain the core code, the plugins, the themes, the images, file based configs, ..
  • Database which contains the contents (pages, posts, comments, …) of your site.

You can backup/restore these parts of WordPress either manually or by plugins.

Which method to use depends on the frequency one or both of those two parts (files and or contents) of your WordPress site change over time. If you have a static page, which you rarely change, then manual backup could be quite suitable.

But if you have regular changes on your site, be it changed files (plugins, images, themes, …) or changed contents (pages, posts, comments, …) you will have an easier life using plugins.

Most of plugins also allow you to configure different backup frequency for files as compared to data, given the fact that usually the data is more frequently changed than the files of the website.

Its also worth noting that usually the backup of the files requires more space than the backup of the database data.

Manual method using FTP and phpMyAdmin

Backup

  • Copy the entire root folder of your WordPress-Installation to your local computer. You can do this for example via FTP.
  • Backup your WordPress MySQL DB to your local computer.
    • Often your hosting provider offers a web management tool for MySQL such as phpMyAdmin for example. The connection string to your WP DB should be visible somewhere on your Hosting pannel and the DB PW is likely provided to you during registration of your Web Hosting Account. With those data you can login to your MySQL management tool e.g. phpMyAdmin and then you can backup your entire WP DB using the [Export] tab for example and then you can download your DB as a SQL script, which can be used to recreate your entire WP DB:

Restore

  • Upload your local Backup of the WordPress-Folder into your Website Root folder.
  • Restore your local Backup of the WordPress-DB into your Website MySQL Server. If you restore your DB using phpMyAdmin, you might have to first remove all tables of the database before importing the SQL file you created during export (backup), otherwise the import process might complain about existing tables.

Backup & Restore with Plugins

UpdraftPlus

UpdraftPlus is one of the most popular WordPress backup plugins and its free, at least without all its additional add-ons.

Ones you have installed and activated the plugin, you can start to configure and test it under [Plugins > UpdraftPlus – Backup/Restore > Settings]:

As mentioned above it makes sense to select different frequencies for backing up the files and data, due to their different change frequency and size. Then you can chose the storage where to store the backups.

Backup and restore process with Updrafplus is pretty straight forward and intuitive, you have to be aware that Updraftplus works only if the WordPress is still working and accessible. If your WordPress page breaks down, you can no longer use Updratplus for backup or restore. In case your WordPress page is no longer accessible you may try the following steps to recover your page:

  • Backup the files of the corrupted installation from FTP.
  • Backup the DB of the corrupted installation.
  • Then replace the files of the corrupted installation with a relatively UpToDate WordPress installation, which can be from any other side.
  • Replace the wp-config.php file of the replaced installation with the wp-config.php of the corrupted installation you backed up before.
  • Now WordPress should be accessible and running (if the problem is not from DB but rather from files).
  • Now you can install Updraftplus plugin (if its not installed) and then start to restore Updraftplus backups.

Migration

Domain name change and redirection

Recently I had changed my WordPress web site domain name from http://wp.littleitkb.com to http://iteacorner.com. I followed some howto’s on how to change the domain name of a WordPress. The whole operation worked quite well but I faced troubles with redirection from my old address to the new address.

Having a working redirection from the old domain name to the new one is not only important to allow your visitors to find your page again but its also important for Google SEO. Google seem to rank older pages better than brand new ones. If you have a web site which has been indexed by Google for months or years and you change your web site domain name, then the new web site will appear to Google as a totally new site, unless you tell Google (via Google Console) that you have changed your web site domain name.

Once you tell Google about your name change, it starts a process which might take a while until your old web address is transferred into the new web address. During this process Google tries to map any page of your old web site to the corresponding page of your new web site.

If the redirection does not work properly this process of transformation by Google becomes blocked and you will see the message “This website is currently transitioning to …” for a very long time:

In my case it was quite hard to get the redirection working properly. The problem is that the redirection can be affected by several factors, here are the factors which affected my case:

  • Redirection configured for IIS server
  • Redirection inside WordPress itself.
  • Domain names assigned to the web page.
  • SSL certificates configured for the old and the new domain names.

Very useful for debugging and troubleshooting is the WordPress Redirection plugin:

This plugin has a very useful feature which allows you to see how requests are redirected as the following example shows:

Here is how I managed to get the redirection working in my case:

I added the following rule to the web.config of the web site:

<rule name="redirect" stopProcessing="true">
 <match url="^(.*)$" />
 <action type="Redirect" url="https://iteacorner.com/{R:0}" appendQueryString="true" />
 <conditions>
     <add input="{HTTP_HOST}" pattern="^wp.littleitkb.com$" />
 </conditions>
</rule>       

I made sure that the address www.wp.littleitkb.com would still be assigned to the web page along side the new address iteacorner.com.

I made sure that both domain names the old (wp.littleitkb.com) and the new (iteacorner.com) had each a valid SSL certificate installed.

I made sure that no redirection was configured inside WordPress, so I used the Redirection plugin only for its nice debugging feature but removed any redirection there.

That’s how I was able to get my redirection working after many failed attempts. Maybe this info’s can be useful in your case too.

Exporting & Importing of pages

WordPress offers functionality for exporting and also importing a post or a page which can be used in a migration scenario.

Exporting

Exporting specific posts

The out of the box export tool of WordPress does not offer the possibility to browse and select specific post(s) for export. But it allows you to export all posts of a specific category.

So, if you want to post specific post(s) one way would be to first add a category for the selected post(s) e. g. the category “ToExport” which would then allow to select that/those post(s) from within the export tool.

This is how we can add a category “ToExport” to a post:

We open the post we want to categorize and then click on the right side on the [Add New Category] button:

After adding the category we can see it as a new checkbox:

Make sure to unselect the “Uncategorizes” category:

Now we can open the menu [Tools\Export]:

Select the [Posts] option and then select the category we just added to the post we would like to export and click on [Download Export File]:

Importing

Importing specific posts

Go to the WordPress site you want to import the post(s) you have exported before. Open [Tools\Import] and install the WordPress import tool:

After the WordPress import tool is installed, click on [Run importer]:

Browse and select the file to import and then click on [Upload file and import]:

Check [Download and import file attachments] and submit the import:

After that the post(s) will be available on the new WordPress site.

Troubleshooting

Problem

Sometimes its possible that after renaming the WordPress web address the image links end up broken. After all that is what happened to me despite having followed the guides how to change the web address of my WordPress page.

Resolution

Regardless what the cause of the broken image links might be, one potential way to fix this problem is using SQL queries directly on the WordPress database.

To do that go to the phpMyAdmin page for your WordPress database. Should be somehow accessible from your Web hosting control panel.

Login to phpMyAdmin.

On the left side you will find the wp-posts table, click on it to open it.

Click on the [SQL] tab.

Enter the following SQL query to replace the old WordPress web address with the new one:

UPDATE wp_posts SET post_content=(REPLACE (post_content, ‘old-web-address’,’new-web-address’));

Related topics

WordPress: Gutenberg editor, basic editing functions