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
Vector Search -An Introduction in Oracle Database 23ai.pptx
Getting to WordPress
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. M O V I N G S U C K S .
https://www.flickr.com/photos/picturesofthings/3276020078/
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. I M P O R T
S E R V I C E S
https://www.flickr.com/photos/travosaurus/14805424435
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. T I D Y D A T A B A S E
https://www.flickr.com/photos/telstar/6859351675/
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. 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. R E A D Y T O
G O ?
https://www.flickr.com/photos/brad_frost/9159754008/
26. 1 . C O N T E N T M O D E L
MIRROR OR IMPROVE:
• Custom post types
• Custom fields
• Taxonomies
27. 1 . C O N T E N T M O D E L
INCLUDE FIELDS:
• IDs
• Paths
• Author ID or email
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. 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. 2 . E X P O R T
https://www.flickr.com/photos/booleansplit/7286682184/
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. 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
35. A S S E S S
T H E M E S S
https://www.flickr.com/photos/glenscott/3388493598/
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. 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. 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. R E D I R E C T S
https://www.flickr.com/photos/nnova/8227348112/
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
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. 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. S T E P H A N I E L E A R Y . C O M @ S L E A R Y