PHP script to export Wordpress blog posts to Tumblr ( with support of posts types, tags, categories, some shortcodes, secondary blog, etc )
PHP Shell
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
README.md
config.sample.php
delete-tumblr-posts.php
functions.shortcodes.php
import-tumblr.php
launch-delete.sh
launch.sh

README.md

#Wordpress to Tumblr

##About

PHP script that help to export Wordpress posts to Tumblr.

It can serve as a basis because it contains the resolution of several export issues :

##Features

  • Support secondary Tumblr blog for destination ( group )

  • Import Tags

  • Import posts types according to categories

  • Use custom fields to import

  • Make a list of source/destination posts URL to easily create redirections rules ( eg. redirect permanent 301 Apache )

  • Deals with [sourcode] and [caption] Wordpress shortcodes ( using the backpress shortcodes lib )

  • Sourcecodes can be highlighted with google-code-prettify

  • Fill the Tumblr post Slug with the Wordpress post name

##Configuration

Copy, rename and edit the sample configuration file config.php.sample to config.php

##Prerequisites

To obtain an export file from Wordpress, go to the wp-admin menu and choose Tools>Export. Select Articles and push the Download button.

The script can simply export all posts as Regular, but it was also made to deal with categories and custom fields ( if you have previously tried to make Wordpress look like Tumblr with a custom taxonomy and Custom Field Template ).

Indicate in config.php the category which represent the posts types in $tumblogWPCategory . Then indicate the corresponding terms for each type in $tumblogWPCategoryTermsMatches.

Consider that as it is, the script support this custom fields :

  • link : link-url
  • photo : image
  • video : video-embed
  • quote : quote-author, quote-copy ,quote-url
  • audio : audio

##Photos and images Photos are automagically uploaded to Tumblr when using the photo post type. However, images of the post body are not uploaded. You have to maintain them in a CDN for instance. In the config file, you can relocate images paths using the $relocateBodyImages array.

$relocateBodyImages = array( 
"http://myblog.com/wp-content/uploads/" 
=> "media.myblog.com/tumblelog/"
);

##Redirection

In the config file, indicate a file name for $logFile.

The log file is in the CSV format :

 source-URL ; destination-URL

So you can easily create rules for your web server.

Redirect permanent source-URL destination-URL 

##Misc

The script delete-tumblr-post.php is a utility to delete all post of the tumblr blog.

These scripts use the Tumblr API v1

###Disclaimer

This script is based on the Wordpress-to-Tumblr script, but it's not a Fork in view of all changes and additions that are made.