Getting special character HTML to show up in HTML code

If you type in something like & copy ; and then toggle back to the visual editor it will convert this to ©

Some older computers will not be able to interpret this symbol and show a question mark it its place.  To prevent this from happening we found this code on Stack Exchange.

// Custom configuration for TinyMCE
function wpsx_54398_configure_tiny_mce( $initArray ) {

    // Add some common entities to the default array (copy, reg, trade, service mark, euro)
    // The odd entires are the entity *number*, the even entries are the entity *name*. If the entity has no name,
    // use the number, prefixed with a hash (for example, the service mark is "8480,#8480").
    $initArray['entities'] = $initArray['entities'] . ',169,copy,174,reg,8482,trade,8480,#8480,8364,euro';

    return $initArray;

}
add_filter('tiny_mce_before_init', 'wpsx_54398_configure_tiny_mce');

Getting images to float without extra margin or page breaks

By default the WordPress visual editor will ad ‘p’ tags to all of your text and images. When you are floating an image the p tag around it can create more margin than you want, and it often ads an extra ‘br’ tag to the code which can cause spacing problems.

Add the following code to the functions.php file to prevent the IMG tags from being wrapped in a p tag.

Thanks to Css-Tricks.com for this code. css-tricks.com/snippets/wordpress/remove-paragraph-tags-from-around-images/

function filter_ptags_on_images($content){
   return preg_replace('/<p>\s*(<a .*>)?\s*(<img .* \/>)\s*(<\/a>)?\s*<\/p>/iU', '\1\2\3', $content);
}

add_filter('the_content', 'filter_ptags_on_images');

Setting Up Site-Search on Google Analytics

Google Analytics Site Search

  1. After logging into Google analytics, you want to select the profile on where you would like to track the searches.
  2. Click on the admin tab on the top right of the Navigation menu and select the View Settings option under View Column (first option in the column on the right)
  3. Scroll down until you see the Site Search Settings header and turn the button on to allow site search tracking.
  4. In the input field below labeled “Query parameter”, please enter the query parameter for your searches on your site.
    • Just make a test search on your site and look for the letter after the “?” in your URL
    • Enter that letter into the input field(usually the letter “q” or “s”….The WordPress Default is “s”)
  5. You can also track category searches if you please by turning on the Site search categories button and entering the category parameters in the input labeled “Category Parameters”.
  6. Now just Click Save and you are all set!

Website Launch Checklist

Before you launch

Update all plugins and WP core.

Before you run your testing make sure you update everything so you don’t have to retest it again later.

Cross browser testing

Cross browser testing should be done on all page templates (not necessary for all pages) on the following browsers/devices.

  • Internet Explorer 9, 10, 11
  • Latest Version of Firefox
  • Latest Version of Chrome
  • Safari running on a Mac
  • iPhone
  • Android Phone
  • Use Safari Developer mode to test Ipad view.
  • Use responsivetest.net to check responsive view on major mobile screen sizes.

Make a backup of the old site

If it was a WordPress site make sure to grab all of the files in wp-content and a copy of the database.  If it was an HMTL site you can download all of the files and zip them up.  If you do not have FTP access to the old site use the program http://www.httrack.com/ to download a copy of the site.

Other

Check your 404 page by entering a random URL.  You should also perform and check the search template to make sure they look ok.

Before you switch the nameservers or change the @ record put the old nameservers or the old IP address into the password file in case you need to revert back to the old site.

Launching the site (After the DNS switches over)

You will need to change the site address in the wp-config.php file to reflect the live URL.  Do NOT include a trailing slash on the live domain.

Add the website to InfiniteWP by installing or deactivating and reactivating the IWP client plugin.  Create a backup and confirm that it worked before running search and replace.

Install the search and replace plugin.  Do a search in all areas of the database for the development URL and replace it with the live URL.  Be careful not to include a slash on one URL and not the other.  See screenshot for recommended strings.

Screen Shot 2014-04-02 at 11.43.07 AM

Search and replace does not seem to work in widget areas so review all widget areas for links to the old site URL.  Check common theme template files for hard coded links.

Go to settings > reading and uncheck the box to allow search engines to crawl the website.  Go to brokenlinkcheck.com and enter the site URL for a quick check of any broken links.  Fix any that you see.

Gravity Forms settings

If you are going to set up Google Analytics goals make sure you create a thankyou page and set the confirmation to go to the thank you page.

Set the send to email address to the client, we also BCC our info@ address so we have an extra copy of any forms.  Set the Send As address to the info@ or other generic email that the client uses.

Change the subject of the form to include the name of the person who filled it out the form, not the title of the form itself.

Send a test message to the client and ask them to “forward this message back to me to confirm receipt”.  If they do not receive the form tell them to check their spam.  You may need to set up SMTP email if it is not getting through.

Website Setup for SEO clients

Yoast Settings

Configure the SEO settings to no index sup pages of archives.  No index any post types or formats that are not being used as independant URL’s.  For example we may have a post type for SLIDES but these URL’s are not supposed to be viewed individually.  You should also noindex attachments.

You can noindex post formats, and tags if they are not being used.  You can disable the SEO meta box on any post types that are set to noindex.

301 redirects

Install the Simple 301 redirects plugin.  Do a search on Google for site:websiteurl.com to return a list of all URL’s indexed by Google.  Go through each URL and create a redirect to a similar page on the new website.  If a page no longer exists then create a redirect to the home page.

Setup Google analytics.

Create a Google account. See this post for more details. wordpress.boomvisibility.com/setup-google-analytics/ as well as this post for setting up Goals. wordpress.boomvisibility.com/setup-click-goals-google-analytics/

Be sure to share Google analytics with the SEO account manager (charlie.strickler) and the info@boom email address.

Setup Webmaster tools

Add a site to Google WMT and share with the SEO account manager (charlie.strickler) and the info@boom email address.

Create a Microsoft account and add a site to Bing webmaster tools.

DO NOT SUBMIT A SITEMAP UNTIL ALL 301 REDIRECTS AND CACHING HAS BEEN ENABLED.

Final Steps

Delete any development plugins.  This often includes search and replace, regenerate thumbnails.  If you are moving the site from a different host you can delete the old development files.

Run a sitemap generator like auditmypc.com.  Examine the results for broken links, hashtag links, and any URL’s that still point to the development site.

Download W3 total cache or use infinity cache for WP Touch websites.  See this post for how to configure W3 total cache. - http://wordpress.boomvisibility.com/configuring-w3-total-cache/

Run a sitespeed test using pingdom.com/tools.  Add any issues with page load speed to your notes about the launch.

Make a backup on Infinite WP called “PostLaunch”.

Configuring W3 Total Cache

We leaned heavily on advice from WP beginner in this article - http://www.wpbeginner.com/plugins/how-to-install-and-setup-w3-total-cache-for-beginners/

Basically they recommend that you enable Page Cache and Browser Cache which are enabled by default.  You do not need to enable database caching or object caching or minify.

Browser caching is enabled by default but there are some settings to enable in browser caching.

  • Prevent caching of objects after settings change
  • Disable cookies for static files

How to setup on click goals in Google analytics

Screen Shot 2014-03-27 at 5.00.13 PM

<a href="tel:14843629736" onclick="_gaq.push(['_trackEvent','Click-to-Call','Click-to-Call','4843629736']);">484-362-9736</a>

Note that we are only adding one category name when we setup the goal but we fill out several more variables in the onclick code. We do this because the onclick code requires a category, an action and a value.

Goals do NOT register immediately so after you set one up you will have to click on the phone number, then check a few days later to make sure it was recorded.

How to Setup Google Analytics

The first step to setting up a Google Analytics Account to first setup a Gmail account for the client (IF you or the client has not already done so).
Once the Gmail account has been created, you want to go to www.google.com/analytics/ and register using the account you just made or the existing Gmail account that the client would like to use.
After registration, you will be sent to a screen that displays your UA code or Tracking Code. Copy and paste that code to a text editor because you will need that in a minute.

Now go Install the Google Analytics Plugin to WordPress and activate it. Once you activate it, you will need to navigate to the Settings menu for the Google Analytics Plugin and enable the following settings:

  1. Manually enter the UA Code. This is were you enter that UA code that you had copied and pasted in the previous steps
  2. Advanced Settings
  3. Logged in users under the Custom Variables menu
  4. The above settings will look like this:
    Capture
  5. Finally change the ignore users drop-down selection, under Advanced Settings, to Editor.
    googleAnalyticsScreenshot2

Click the Update Settings button and then click the Allow Tracking button when the notification pops up.

Running backups on Infinite WP

The backups on Infinite WP are really easy. You can select backup now from the site menu on the left of the page, give the backup a name, and press the backup button. For many sites you may not want to backup all your websites files because many of them don’t change very often. For example the wp-includes and wp-admin folders can easily be downloaded.

wp-admin, wp-includes

Keep in mind that you may have more than one website folder on your webserver and you should also ignore a secondary website and do that backup separately.

Screen Shot 2014-03-27 at 4.52.36 PM

We usually only keep 3 backups on file because most web hosting companies do a daily backup of all their sites that we can retrieve in an emergency. We run our backups before and after we update our WordPress core and plugins so usually our backups are like this.

  • PostUpdate – older
  • PreUpdate – before the most recent update
  • PostUpdate – After the the most recent update

Set the # of Backups to 4 when you run the backup and it will delete older backups from the folder automatically. Unfortuneately InfiniteWP does not seem to remember what number you set this to so you will have to change it every time you run an update.

How to Setup a WordPress Website

The first step to setting up WordPress would be to obviously install WordPress to your hosting site.

Once WordPress is installed you want to turn off the Robots so that Google cannot index your pages while you are still in the development stages.
To do this you must:

  1. Log into the WordPress admin dashboard
  2. Go to the Settings option on the side navigation
  3. Click on the Reading link from the slide out menu
  4. Click on the check box next to the title “Search Engine Visibility”
  5. Click Save Changes

The next step to setting up word press would be to disable the commenting. To do this you must:

  1. Go to back to the Settings option and Click on the Discussions link
  2. Next you will turn off the top three check boxs.
  3. Click Save Changes

How to create an HTML sitemap page template

We owe all of the credit on this post to Yoast who gave us most of this code from this post.  Create a new page template called sitemap and use the code to generate a list of pages and posts.

<h2 id="pages">Pages</h2>
<ul>
<?php
// Add pages you'd like to exclude in the exclude here
wp_list_pages(
  array(
    'exclude' => '',
    'title_li' => '',
  )
);
?>
</ul>

<h2 id="posts">Posts</h2>
<ul>
<?php
// Add categories you'd like to exclude in the exclude here
$cats = get_categories('exclude=');
foreach ($cats as $cat) {
  echo "<li><h3>".$cat->cat_name."</h3>";
  echo "<ul>";
  query_posts('posts_per_page=-1&cat='.$cat->cat_ID);
  while(have_posts()) {
    the_post();
    $category = get_the_category();
    // Only display a post link once, even if it's in multiple categories
    if ($category[0]->cat_ID == $cat->cat_ID) {
      echo '<li><a href="'.get_permalink().'">'.get_the_title().'</a></li>';
    }
  }
  echo "</ul>";
  echo "</li>";
}
?>
</ul>

You may also want to include a search form at the top of the page if it isn’t part of the website shell.

<?php get_search_form(); ?>