How To Change Email Sender Name on WordPress Site

If your WordPress on Linux site is setup to send emails when users register, forget their passwords, or to send notifications when a new post is published, you may notice the senders email looks a little something like this:
Wordpress <wordpress@yourhostname.yourdomain.name>

This can easily be customized to reflect a different sender name.

From the Linux shell, navigate to /var/www/html/wp-includes and open pluggable.php in your favorite editor. I use vim so my command looks like this:

vim /var/www/html/wp-includes/pluggable.php

Search for the string ‘from_name’. This is done by entering

/from_name

It should take you to a section that looks like this:

$from_name = 'WordPress';

Change ‘WordPress’ to MyBlog, admin, your name or whatever sender name you’d like to use.

Next, search for the string ‘wordpress@’. This is done entering

/wordpress@

There are two areas this needs to be changed. The line of code displays ‘wordpress@yourdomain.com.’ Change ‘wordpress’ to admin, your name or whatever username you’d like to use. Possibly one of your domain email accounts. Keep in mind, this only changes the username@, not the domain name itself.

When finished, emails will be coming from:

YourNameofChoice <usernameofchoice@yourhostname.yourdomain.name>

How To Add Keywords To WordPress Theme Using Tags

Log into Admin panel
On the left-hand navigation menu, navigate to Appearance>Editor
On the right-hand side, find the header.php file
Locate the Title tag
Place the following code just below the title:

<meta name="keywords" content="<?php
$posttags = get_the_tags();
if ($posttags) {
  foreach($posttags as $tag) {
    echo $tag->name . ', '; 
  }
}
?>how to" />

I placed a generic tag “how to” at the end to avoid trailing my keywords with a lonely comma. My blog is mostly a How-To so it’s appropriate.

Then, press the “Update File” button.

To see the changes, view your post. Once it’s open, go to the Tools section in your browser and select View Source.

Your header area should display your keywords below your title area as such:

<meta name="keywords" content="add, function, keywords, tags, theme, wordpress, how to" />

How To Ensure WordPress Auto Updates Work on Self-Hosted Linux Machine

Share on LinkedIn

I’ve been meaning to get this posted for some time now. It could prove useful to someone hosting their own WordPress site on a self-hosted Linux machine.

When you are logged into the admin console of your WordPress site, you will get notifications of needed updates. You may also want to upload new themes from time-to-time.

When you go to perform the Automatic Update, it will work without issue so as long as your permissions are setup properly on your apache web server.

If you find yourself running into this issue, ssh into the backend of your apache web server and follow these simple steps:

1. Set ownership of /var/www/html and make changes recursive

chown -R apache:apache /var/www/html

2. Ensure the apache user/group can write to /var/www/html and make changes recursive

chmod -R 0775 /var/www/html

3. Restart apache

service httpd restart

Once you made those changes to the backend, try to run the update(s) again from the admin portal. You should be all good to go from there.

WordPress Import Failure Blank Screen

When trying to import a WordPress XML dump from another instance, after submitting the upload it returned a blank screen containing only “Import WordPress”.

A quick check of the php logs showed the entry:

PHP Fatal error: Class ‘DOMDocument’ not found in /home/xxxxxx/wp-content/plugins/wordpress-importer/parsers.php on line 61

You just need to install the php-xml module.

yum install php-xml

service restart httpd

Refresh your browser and try it again. Should be all good.