45
GETTING TO WORDPRESS WP CAMPUS 2016 https://www.flickr.com/photos/rogersmj/3529152 Stephanie Leary @sleary sleary.me/wpcampus2016

Getting to WordPress

Embed Size (px)

Citation preview

Page 1: Getting to WordPress

G E TT I N G T O W O R D P R E S S

WP CA MPU S 2016

https://www.flickr.com/photos/rogersmj/3529152061/

Stephanie [email protected]/wpcampus2016

Page 2: Getting to WordPress

M OV IN G S U C K S .

https://www.flickr.com/photos/picturesofthings/3276020078/

Page 3: Getting to WordPress

I M PO RT PLU G I N SHTTP : / / C O DE X . W O R DP R E S S . O RG/ I MP O RT I N G_ C O N T E N T

https://www.flickr.com/photos/sisterdanger/24773994365/

Page 4: Getting to WordPress

I M PO RT SE RV I C E S

https://www.flickr.com/photos/travosaurus/14805424435

Page 5: Getting to WordPress

IM P O RT A N Y T H IN GYOU GOT T H I S

Page 6: Getting to WordPress

T I DY DATA B A S E

https://www.flickr.com/photos/telstar/6859351675/

Page 7: Getting to WordPress

W P A LL I M P O RTOP T IO N 1 :

Page 8: Getting to WordPress

W P A LL I M P O RTOP T IO N 1 :

Page 9: Getting to WordPress

W P A LL I M P O RTOP T IO N 1 :

Page 10: Getting to WordPress

W P A LL I M P O RTOP T IO N 1 :

Page 11: Getting to WordPress

W P A LL I M P O RTOP T IO N 1 :

Page 12: Getting to WordPress

W P A LL I M P O RTOP T IO N 1 :

Page 13: Getting to WordPress

S TAT I C F I LE S

https://www.flickr.com/photos/catjannik/381162608/

Page 14: Getting to WordPress

H T M L I M P O RTOP T IO N 2 :

Page 15: Getting to WordPress

H T M L I M P O RTOP T IO N 2 :

Page 16: Getting to WordPress

H T M L I M P O RTOP T IO N 2 :

Page 17: Getting to WordPress

H T M L I M P O RTOP T IO N 2 :

Page 18: Getting to WordPress

H T M L I M P O RTOP T IO N 2 :

Page 19: Getting to WordPress

H T M L I M P O RTOP T IO N 2 :

Page 20: Getting to WordPress

H T M L I M P O RTOP T IO N 2 :

Page 21: Getting to WordPress

H T M L I M P O RTOP T IO N 2 :

Page 22: Getting to WordPress

D IY

https://www.flickr.com/photos/catjannik/381162608

Page 23: Getting to WordPress

DI Y I M PO RT E R

1. Fetch data from <somewhere>

2. Loop through each item

3. Assemble pieces into $post array

4. wp_insert_post()

5. wp_set_post_terms()

6. add_post_meta()

O PT I ON 3 :

Page 24: Getting to WordPress

DI Y I M PO RT E R

foreach ( $things as $thing ) { $post = array(); $post['post_content'] = $thing->content; $post['post_status'] = $thing->status; $post['post_title'] = $thing->title; wp_insert_post( $post );}

O PT I ON 3 :

Page 25: Getting to WordPress

R E A DY T O G O ?

https://www.flickr.com/photos/brad_frost/9159754008/

Page 26: Getting to WordPress

1 . C O N TE N T M O D E L

MIRROR OR IMPROVE:

• Custom post types

• Custom fields

• Taxonomies

Page 27: Getting to WordPress

1 . C O N TE N T M O D E L

INCLUDE FIELDS:

• IDs

• Paths

• Author ID or email

Page 28: Getting to WordPress

1 . C O N T E N T M O D E LDIY C O DE

Page 29: Getting to WordPress

1 . C O N T E N T M O D E LCUS T O M PO S T T Y P E U I P LUG I N

Page 30: Getting to WordPress

1 . C O N T E N T M O D E LADVAN CED CU ST O M F IE L DS PLU G IN

Page 31: Getting to WordPress

2 . E X P O RT

https://www.flickr.com/photos/booleansplit/7286682184/

Page 32: Getting to WordPress

2 . E XPO RT

CHECK:

• HTML vs plain text fields

• Date formatting

• Character encoding

• Commas in tags / categories / terms

• Relative link & image paths

Page 33: Getting to WordPress

3 . S TAG I N G

• Give PHP ALL THE MEMORY

• Turn off plugins, publicize tools, etc.

• Back up both databases

• Warn system administrators

Page 34: Getting to WordPress

G O

Page 35: Getting to WordPress

A S SE SSTH E M E SS

https://www.flickr.com/photos/glenscott/3388493598/

Page 36: Getting to WordPress

PO ST- I M PO RT PLU G I N S

• Search and Replace

• Post Type Switcher / Convert Post Types

• Term Management Tools

• Add Linked Images to Gallery

• Admin Columns

• Content Audit

Page 37: Getting to WordPress

C L E A N U P E XA M PL E

1. WP All Export custom field

2. WP All Import the field as term

3. Merge duplicates & typos w/Term Management Tools

Page 38: Getting to WordPress

A D M I N C O LU M N S PLU G I N

FAS T R E V IE W IN G

Page 39: Getting to WordPress

R E D I R E C T S

https://www.flickr.com/photos/nnova/8227348112/

Page 40: Getting to WordPress

R E D I R E C T O PT I O N S

1. .htaccess

2. Redirection plugin

3. DIY codehttp://stephanieleary.com/?p=8220

Page 41: Getting to WordPress

. h t a c c e s s

Page 42: Getting to WordPress

R E D I R E C T I O N P LU G I N

Page 43: Getting to WordPress

DI Y R E D I R E C T S

add_filter( 'redirect_canonical', 'my_404_no_guessing', 10, 2 );

function my_404_no_guessing( $redirect_url, $request_url ) { if ( is_404() ) {

$posts = get_posts( array( 'meta_key' => 'URL_before_HTML_Import','meta_value' => $request_url, 'post_type' => 'any','posts_per_page' => 1,'fields' => 'ids',

) );if ( $posts ) {

$redirect_url = get_permalink( array_pop( $posts ) );}else

return false; } return $redirect_url;}

HT ML IMPO RT

Page 44: Getting to WordPress

add_filter( 'redirect_canonical', 'my_404_no_guessing', 10, 2 );

function my_404_no_guessing( $redirect_url, $request_url ) { if ( is_404() ) {

$posts = get_posts( array( 'meta_key' => 'drupal_path','meta_value' => parse_url( $request_url,

PHP_URL_PATH ), 'post_type' => 'any','posts_per_page' => 1,'fields' => 'ids',

) );if ( $posts ) {

$redirect_url = get_permalink( array_pop( $posts ) );}else

return false; } return $redirect_url;}

DI Y R E D I R E C T SDR UPAL / W P A LL IMPO RT

Page 45: Getting to WordPress

S TE P H AN I E LE A RY. C OM @S LE ARY