Optimizing Your WordPress Site

Post on 11-Jan-2017

24 views 1 download

Transcript of Optimizing Your WordPress Site

Optimizing WordPressFindable, Future-Proof & Fast

Phil Buckley July 2016 Raleigh SEO Meetup

19 things that you need to know

Themes

@1918 2

Choose a sustainable theme

@1918 3

Although you can change themes anytime you want, it’s not as easy as it seems. Different themes use different features, image sizes and widgets.

Choose a theme as if you’ll never change it… because you probably won’t.

Don’t Modify the HTML

@1918 4

It’s easy to add a snippet into the header.php file for your theme. Don’t do it.

Theme updates will overwrite that modification. Use the power of functions.php to inject into your templates.

Use Child Themes

@1918 5

When you update a theme, everything except the images and content can change. If you modify a template, it will get overwritten with the next theme update… unless you are modifying a child theme.

Using (or creating) a child theme allows you to update the main theme without overwriting the child’s mods.

Plugins

@1918 6

Limit Plugins

@1918 7

There’s a plugin for everything, but you probably don’t need most of them. They can slow down your site, cause security problems and even break other features.

Try to accomplish what you need without a plugin first, use plugins only to accomplish important things.

Essential Plugins

@1918 8

You can live without most plugins, but here’s some that I always install:• Akismet (spam killer)• Cookies for Comments (human spam killer)• Jetpack (WordPress additional functionality)• Yoast SEO (SEO simplified)

Spam

@1918 9

Build a Comment Blacklist

@1918 10

Spammers never sleep. Build out a blacklist that contains phrases that trigger either moderation or spamming.

Activate Akismet before you go live!

Mine runs from “-online” to “Zyrtec” and if a comment contains any of those words, it gets flagged for moderation.

Permalinks

@1918 11

Use Better Permalinks

@1918 12

You can choose any URL structure you want, so don’t default to example.com/?p=123.

I usually recommend a Custom Structure:http://example.com/%category%/%postname%

Build Smarter Slugs

@1918 13

You can edit the URL of the page to be slightly different than the title of your post.

Titles

@1918 14

and other stuff close by

Titles vs Headlines

@1918 15

When you write in the “Enter Title Here” box, Wordpress will use that for the page title and page headline (h1) by default.

You don’t have to accept the defaults!

Titles vs Headlines

@1918 16

@1918 17

Title

Slug

Headline

Meta Description

@1918 18

Don’t think of this as a “description” of the page. Think of it as an AdWords snippet for the page.

Clickability is the key. Make me want to click your result.

Meta Description

@1918 19

Images

@1918 20

@1918 21

Stock Photos

Featured Images

@1918 22

This is the image that will be shared with your link when you post to social media – choose something interesting.

A great image can increase click throughs over 400%

Scrolling

@1918 23

Try to insert an image (or something non-text) often enough that when visitors scroll down the page, it’s never just a giant block of text.

@1918 24

Hooks

Actions & Filters

@1918 25

//* Change the footer text *//add_filter('genesis_footer_creds_text', ‘my_footer_creds_filter');function my_footer_creds_filter( $creds ) {

$creds = '[footer_copyright] &middot; <a href="http://1918.me">1918.me</a>';

return $creds;}//* Add additional fields to user accounts *//function my_new_contactmethods( $contactmethods ) { //** Add Twitter */ $contactmethods['twitter'] = 'Twitter profile URL'; //** Add Facebook */ $contactmethods['facebook'] = 'Facebook profile URL';

//* Change the footer text *//

@1918 26

@1918 27

//* Add additional fields to user accounts *//

//* Add additional fields to user accounts *//

@1918 28

@1918 29

Smarter Code

Added local business schema markup to the footer.

@1918 30

Frameworks

Smart Frameworks

@1918 31

Some themes sit on top of a “framework” that adds additional hooks for you to manipulate.

The framework is a parent theme and the “designed theme” is a child theme.

Typical Theme Installation

@1918 32

Smart Frameworks I’ve Tried

@1918 33

• Genesis by Studiopress• Headway• Divi by Elegant Themes• Thesis 2.0 by DIY themes

Genesis Framework

@1918 34

Using the Simple Hooks plugin I can inject code snippets.

This example is adding GA, Font Awesome CSS and the Facebook tracking pixel.

Forms

@1918 35

Default Forms

@1918 36

WordPress comes with a perfectly good form, but it’s functionality is limited.

For serious forms, you’ll want to buy a better solution.

I recently started using NinjaForms and love it.

Default Forms

@1918 37

WordPress comes with a perfectly good form, but it’s functionality is limited.

For serious forms, you’ll want to buy a better solution.

I recently started using NinjaForms and love it.

Conditional Logic

@1918 38

If a visitor answers question 1, display question 2, otherwise jump to question 3.

Example: this question only appears if 2 previous questions have certain answers.

Performance

@1918 39

Faster is Better

@1918 40

User and search bots like sites that respond quickly.

You have more control over it than you know.

Hosting

@1918 41

You get what you pay for… to a point.

Decide up front what you can afford, then find the best for that price. If $100/year seems like crazy-expensive luxury, you will be limited in your choices.

Think of all the crap you spend $10/month on now.

Does Hosting Really Matter?

@1918 42

Waterfall

@1918 43

Check your WordPress site with a tool that tracks download speed.

• Gtmetrix• Pingdom• Web Page Test

Waterfall Tests

@1918 44

Caching

@1918 45

Think about how often the parts of your site change. You could probably take advantage of aggressive caching. WP Super Cache actually builds out static html pages to load your site even faster.

W3 Total Cache is also a great free option.

Canonicalization

@1918 46

Make sure your site is properly canonicalized! If you’re not sure what that means, think of it as www or non-www version of your site.

Pick one version and stick with it.

A Canonicalization True Story

@1918 47

There was a site that responded to both www and non-www with a 200 (OK) code. This was the problem when you asked for the non-www version…

1. Request non-www version of the site.2. Web server looks in the folder where WordPress will serve the page.3. Sees in the .htaccess file that it should check the cached file (look at you caching files!)4. Checks the cache for that file – it doesn’t exist.5. Back to WordPress to create that page on the fly.6. WordPress has to make a request to the database, where it realizes the url to serve should be the www version of the site.7. Web server now returns the headers for the 301 redirect.8. Web server now returns to the folder from step 2.9. Sees the .htaccess file that it should check for the cached file just like before.10. Checks for the cached file, it still doesn’t exist.11. WordPress generates that file on the fly and starts to load the page.