Skip to content

Configuration

Create a feed-me.php file under your /config directory with any of the following. Feed Me’s configuration file allows customization per-environment and per-feed (see feedOptions).

php
<?php

return [
    '*' => [
        'pluginName' => 'Feed Me',
        'cache' => 60,
        'enabledTabs' => '*',
        'clientOptions' => [],
        'requestOptions' => [],
        'compareContent' => true,
        'skipUpdateFieldHandle' => 'skipFeedMeUpdate',
        'backupLimit' => 100,
        'dataDelimiter' => '-|-',
        'csvColumnDelimiter' => ',',
        'parseTwig' => false,
        'sleepTime' => 0,
        'logging' => true,
        'runGcBeforeFeed' => false,
        'queueTtr' => null,
        'queueMaxRetry' => 5,
        'assetDownloadCurl' => false,
        'feedOptions' => [
            '1' => [
                'feedUrl' => 'https://specialurl.io/feed.json',
                'requestOptions' => [],
            ]
        ],
    ]
];

Configuration options

  • pluginName — Optionally change the name of the plugin.
  • cache — For template calls, change the default cache time.
  • enabledTabs — Hide tabs in the Feed Me navigation. Pass an array with one or more of: feeds, logs, and settings. This does not affect permissions, only the tabs’ visibility!
  • clientOptions — An array of Guzzle client options to be merged with Craft’s defaults.
  • requestOptions — Any additional options to be sent with requests when fetching your feed content Guzzle request options. See an example below.
  • compareContent — Whether to check against existing element content before updating. This can have considerable performance improvements and prevent against needless updating.
  • skipUpdateFieldHandle — Feed Me checks the provided field handle on each element that would be updated while processing a feed. If its value is exactly '1', the element is skipped. This behavior only supports legacy Lightswitch fields in Craft 3.x. If you need to control which elements in a feed are updated, consider preventing it via the craft\feedme\services\Process::EVENT_STEP_BEFORE_PARSE_CONTENT event.
  • backupLimit — Set a limit to the number of backups to keep.
  • dataDelimiter — Feed Me will try and split field values based on this delimiter. Useful for table, checkboxes, and multiselect fields.
  • csvColumnDelimiter — Optionally set the delimiter for columns in CSVs before fetching the content.
  • parseTwig — Whether to parse field data and default values for Twig. Disabled by default.
  • sleepTime — Add the number of seconds to sleep after each feed item has been processed.
  • logging — Set the level of logging to do. Possible values are true (default) to log everything, false to disable logging or error to only record errors.
  • runGcBeforeFeed — Whether to run the Garbage Collection service before running a feed.
  • queueTtr — Set the 'time to reserve' time in seconds, to prevent the job being cancelled after 300 seconds (default).
  • queueMaxRetry — Set the maximum amount of retries the queue job should have before failing.
  • assetDownloadCurl — Use curl to download assets from a remote source. Can be used when issues arise using the default implementation.
  • assetDownloadGuzzle — Use Guzzle to download assets from a remote source. Can be used when issues arise using the default implementation.
  • feedOptions — Provide an array of any of the above options (or feed settings) to set or override for specific feeds, keyed by their existing feed IDs. Note that feed IDs may be different across environments!

Example requestOptions

See Guzzle Options for the full range:

php
'requestOptions' => [
    'headers' => [
        'Accept' => 'application/json',
    ],
    'auth' => [
        'username', 'password'
    ],
    'query' => [
        'foo' => 'bar'
    ],
],

Control Panel

You can also manage configuration settings through the control panel by visiting Settings → Feed Me.