Skip to content

Coming from WordPress

Capell is a Laravel application you own, so most WordPress ideas map to Laravel code plus editor screens in Admin.

WordPressCapellWhere it lives
Page or postPagePages in Admin
Post typePage type (blueprint)Build your first page type
Custom fieldEditor field on a configurator, stored in metaServicePageConfigurator in that guide
BlockWidget on a layoutWidget registration
ShortcodeWidget or Blade componentPublic Blade receives hydrated data
Theme and functions.phpTheme views plus Laravel providersapp/Providers, resources/views/capell
PluginComposer packagePackages
wp_query in a templateRender data contributorTemplates never query models

For a site with a Service post type, a price custom field and posts at addresses such as /services/logo-design/:

  1. Create the page type and field by following Build your first page type. That guide seeds a Brand Sprint service page at /services/brand-sprint. Do not import a post that has the same address, because the page you already have serves it and no redirect is made.

  2. To keep old addresses, install URL Manager before you import. It is a paid package, so you need the Composer repository and credential described in Paid package access before composer require can find it. Require WordPress Importer in the same step, because it is paid too. Without URL Manager the import still succeeds, but it creates no redirects and old addresses return 404:

    Terminal window
    composer require capell-app/url-manager capell-app/wordpress-importer
    php artisan capell:package-cache:clear
    php artisan capell:extension-install capell-app/url-manager

    The install step also activates WordPress Importer and Migration Assistant, which it requires.

  3. Create one page per post in Admin, or import the WXR export with WordPress Importer. Run it first without --execute to preview, then with the target IDs. --type-id must be a blueprint of type page: use the ID of the Service blueprint from the previous guide. On a new starter project it is 10; print yours with this command:

    Terminal window
    php artisan tinker --execute='echo Capell\Core\Models\Blueprint::where("key", "service")->value("id");'
    php artisan wordpress-importer:import site.xml
    php artisan wordpress-importer:import site.xml --execute --site-id=1 --layout-id=1 --type-id=10 --actor-id=1

    Imported pages get an address from their title, so /services/logo-design/ becomes /logo-design, and URL Manager adds a 301 from the old address.

  4. The import does not copy custom fields. Open each imported service in Admin and enter its Price, because the public page shows an empty price until you do. The starter layout shows each page’s title and summary, so add the imported body text to the layout when you convert it.

  5. Replace each shortcode with a widget or Blade component.

  6. Request each old address anonymously and check it redirects to the new page:

    Terminal window
    curl -sI http://localhost:8000/services/logo-design/