Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
PHP script to export Wordpress blog posts to Tumblr ( with support of posts types, tags, categories, some shortcodes, secondary blog, etc )
PHP
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

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.

Something went wrong with that request. Please try again.