Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
G E T T I N G T O
W O R D P R E S S
W P C A M P U S 2 0 1 6
https://www.flickr.com/photos/rogersmj/3529152061/
Stephanie L...
M O V I N G S U C K S .
https://www.flickr.com/photos/picturesofthings/3276020078/
I M P O R T
P L U G I N S
H T T P : / / C O D E X . W O R D P R E S S . O R
G / I M P O R T I N G _ C O N T E N T
https://...
I M P O R T
S E R V I C E S
https://www.flickr.com/photos/travosaurus/14805424435
I M P O R T A N Y T H I N G
Y O U G O T T H I S
T I D Y D A T A B A S E
https://www.flickr.com/photos/telstar/6859351675/
W P A L L I M P O R T
O P T I O N 1 :
W P A L L I M P O R T
O P T I O N 1 :
W P A L L I M P O R T
O P T I O N 1 :
W P A L L I M P O R T
O P T I O N 1 :
W P A L L I M P O R T
O P T I O N 1 :
W P A L L I M P O R T
O P T I O N 1 :
S T A T I C F I L E S
https://www.flickr.com/photos/catjannik/381162608/
H T M L I M P O R T
O P T I O N 2 :
H T M L I M P O R T
O P T I O N 2 :
H T M L I M P O R T
O P T I O N 2 :
H T M L I M P O R T
O P T I O N 2 :
H T M L I M P O R T
O P T I O N 2 :
H T M L I M P O R T
O P T I O N 2 :
H T M L I M P O R T
O P T I O N 2 :
H T M L I M P O R T
O P T I O N 2 :
D I Y
https://www.flickr.com/photos/catjannik/381162608
D I Y I M P O R T E R
1. Fetch data from <somewhere>
2. Loop through each item
3. Assemble pieces into $post array
4. wp_i...
D I Y I M P O R T E R
foreach ( $things as $thing ) {
$post = array();
$post['post_content'] = $thing->content;
$post['pos...
R E A D Y T O
G O ?
https://www.flickr.com/photos/brad_frost/9159754008/
1 . C O N T E N T M O D E L
MIRROR OR IMPROVE:
• Custom post types
• Custom fields
• Taxonomies
1 . C O N T E N T M O D E L
INCLUDE FIELDS:
• IDs
• Paths
• Author ID or email
1 . C O N T E N T M O D E L
D I Y C O D E
1 . C O N T E N T M O D E L
C U S T O M P O S T T Y P E U I P L U G I N
1 . C O N T E N T M O D E L
A D V A N C E D C U S T O M F I E L D S P L U G I N
2 . E X P O R T
https://www.flickr.com/photos/booleansplit/7286682184/
2 . E X P O R T
CHECK:
• HTML vs plain text fields
• Date formatting
• Character encoding
• Commas in tags / categories / ...
3 . S T A G I N G
• Give PHP ALL THE MEMORY
• Turn off plugins, publicize tools, etc.
• Back up both databases
• Warn syst...
G O
A S S E S S
T H E M E S S
https://www.flickr.com/photos/glenscott/3388493598/
P O S T - I M P O R T P L U G I N S
• Search and Replace
• Post Type Switcher / Convert Post Types
• Term Management Tools...
C L E A N U P E X A M P L E
1. WP All Export custom field
2. WP All Import the field as term
3. Merge duplicates & typos w...
A D M I N C O L U M N S
P L U G I N
F A S T R E V I E W I N G
R E D I R E C T S
https://www.flickr.com/photos/nnova/8227348112/
R E D I R E C T O P T I O N S
1. .htaccess
2. Redirection plugin
3. DIY code
http://stephanieleary.com/?p=8220
. h t a c c e s s
R E D I R E C T I O N P L U G I N
D I 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( $red...
add_filter( 'redirect_canonical', 'my_404_no_guessing', 10, 2 );
function my_404_no_guessing( $redirect_url, $request_url ...
S T E P H A N I E L E A R Y . C O M @ S L E A R Y
Upcoming SlideShare
Loading in …5
×

Getting to WordPress

1,517 views

Published on

Getting started with WordPress is easy--unless you got started a long time ago in some other CMS, or Dreamweaver or even (shudder) FrontPage. But you and WordPress can still have a happy relationship despite your baggage! In this session, I'll show you how to import almost anything into WordPress. I'll share examples from real projects for each step of the import process:

* Setting up your ideal content model in WordPress
* Cleaning up your import for best results
* Importing from any other CMS, database, or HTML files (yes, files)
* Converting old content to custom post types, taxonomies, and modular fields
* Auditing and cleaning up content in WordPress
* Processes for long-term content strategy & maintenance

Published in: Technology
  • Be the first to comment

Getting to WordPress

  1. 1. G E T T I N G T O W O R D P R E S S W P C A M P U S 2 0 1 6 https://www.flickr.com/photos/rogersmj/3529152061/ Stephanie Leary @sleary sleary.me/wpcampus2016
  2. 2. M O V I N G S U C K S . https://www.flickr.com/photos/picturesofthings/3276020078/
  3. 3. I M P O R T P L U G I N S H T T P : / / C O D E X . W O R D P R E S S . O R G / I M P O R T I N G _ C O N T E N T https://www.flickr.com/photos/sisterdanger/24773994365/
  4. 4. I M P O R T S E R V I C E S https://www.flickr.com/photos/travosaurus/14805424435
  5. 5. I M P O R T A N Y T H I N G Y O U G O T T H I S
  6. 6. T I D Y D A T A B A S E https://www.flickr.com/photos/telstar/6859351675/
  7. 7. W P A L L I M P O R T O P T I O N 1 :
  8. 8. W P A L L I M P O R T O P T I O N 1 :
  9. 9. W P A L L I M P O R T O P T I O N 1 :
  10. 10. W P A L L I M P O R T O P T I O N 1 :
  11. 11. W P A L L I M P O R T O P T I O N 1 :
  12. 12. W P A L L I M P O R T O P T I O N 1 :
  13. 13. S T A T I C F I L E S https://www.flickr.com/photos/catjannik/381162608/
  14. 14. H T M L I M P O R T O P T I O N 2 :
  15. 15. H T M L I M P O R T O P T I O N 2 :
  16. 16. H T M L I M P O R T O P T I O N 2 :
  17. 17. H T M L I M P O R T O P T I O N 2 :
  18. 18. H T M L I M P O R T O P T I O N 2 :
  19. 19. H T M L I M P O R T O P T I O N 2 :
  20. 20. H T M L I M P O R T O P T I O N 2 :
  21. 21. H T M L I M P O R T O P T I O N 2 :
  22. 22. D I Y https://www.flickr.com/photos/catjannik/381162608
  23. 23. D I Y I M P O R T 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 P T I O N 3 :
  24. 24. D I Y I M P O R T 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 P T I O N 3 :
  25. 25. R E A D Y T O G O ? https://www.flickr.com/photos/brad_frost/9159754008/
  26. 26. 1 . C O N T E N T M O D E L MIRROR OR IMPROVE: • Custom post types • Custom fields • Taxonomies
  27. 27. 1 . C O N T E N T M O D E L INCLUDE FIELDS: • IDs • Paths • Author ID or email
  28. 28. 1 . C O N T E N T M O D E L D I Y C O D E
  29. 29. 1 . C O N T E N T M O D E L C U S T O M P O S T T Y P E U I P L U G I N
  30. 30. 1 . C O N T E N T M O D E L A D V A N C E D C U S T O M F I E L D S P L U G I N
  31. 31. 2 . E X P O R T https://www.flickr.com/photos/booleansplit/7286682184/
  32. 32. 2 . E X P O R T CHECK: • HTML vs plain text fields • Date formatting • Character encoding • Commas in tags / categories / terms • Relative link & image paths
  33. 33. 3 . S T A G I N G • Give PHP ALL THE MEMORY • Turn off plugins, publicize tools, etc. • Back up both databases • Warn system administrators
  34. 34. G O
  35. 35. A S S E S S T H E M E S S https://www.flickr.com/photos/glenscott/3388493598/
  36. 36. P O S T - I M P O R T P L U 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
  37. 37. C L E A N U P E X A M P L E 1. WP All Export custom field 2. WP All Import the field as term 3. Merge duplicates & typos w/Term Management Tools
  38. 38. A D M I N C O L U M N S P L U G I N F A S T R E V I E W I N G
  39. 39. R E D I R E C T S https://www.flickr.com/photos/nnova/8227348112/
  40. 40. R E D I R E C T O P T I O N S 1. .htaccess 2. Redirection plugin 3. DIY code http://stephanieleary.com/?p=8220
  41. 41. . h t a c c e s s
  42. 42. R E D I R E C T I O N P L U G I N
  43. 43. D I 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; } H T M L I M P O R T
  44. 44. 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; } D I Y R E D I R E C T S D R U P A L / W P A L L I M P O R T
  45. 45. S T E P H A N I E L E A R Y . C O M @ S L E A R Y

×