Title: WordPress database error: cache_key cannot be null
Last modified: April 7, 2025

---

# WordPress database error: cache_key cannot be null

 *  Resolved [NETPROFIT](https://wordpress.org/support/users/netprofit/)
 * (@netprofit)
 * [1 year, 2 months ago](https://wordpress.org/support/topic/wordpress-database-error-cache_key-cannot-be-null/)
 * After upgrading from PHP 7.4 to PHP 8.4 I get this error:
 *     ```wp-block-code
       WordPress database error Column 'cache_key' cannot be null for query INSERT INTO dhdl_ctf_feed_caches (cache_value, last_updated, cache_key, cron_update, feed_id) VALUES ('[\"error\"]', '2025-04-07 15:40:17', NULL, '', 'legacy') made by require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/dhdl/single-gruender.php'), do_shortcode, preg_replace_callback, do_shortcode_tag, ctf_init, TwitterFeed\CtfFeed->maybeCacheTweets, TwitterFeed\CtfCache->set_transient, TwitterFeed\CtfCache->update_or_insert
       ```
   
 * I found these 2 topics related to this error:
    - [https://wordpress.org/support/topic/cache_key-cannot-be-null-for-query-insert-into-wp_ctf_feed_caches/](https://wordpress.org/support/topic/cache_key-cannot-be-null-for-query-insert-into-wp_ctf_feed_caches/)
    - [https://wordpress.org/support/topic/database-error-in-2-1-1/](https://wordpress.org/support/topic/database-error-in-2-1-1/)
 * Unfortunately the settings do not work anymore (they just load forever), so I
   cleared the cache using this code:
 *     ```wp-block-code
       global $wpdb;$table_name = $wpdb->prefix . "options";$wpdb->query( "    DELETE    FROM $table_name    WHERE option_name LIKE ('%\_transient\_ctf\_%')    " );$wpdb->query( "    DELETE    FROM $table_name    WHERE option_name LIKE ('%\_transient\_timeout\_ctf\_%')    " );global $wpdb;$table_name = $wpdb->prefix . "options";$result = $wpdb->query("    DELETE    FROM $table_name    WHERE option_name LIKE ('%ctf\_\!%')    ");delete_option( 'ctf_cache_list' );
       ```
   
 * But the error still persists. 
   Why is the cache_key rendered NULL? Is there anything
   I can do against it?
    -  This topic was modified 1 year, 2 months ago by [NETPROFIT](https://wordpress.org/support/users/netprofit/).

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Support [Smash Balloon Louis](https://wordpress.org/support/users/smashballoonlouis/)
 * (@smashballoonlouis)
 * [1 year, 2 months ago](https://wordpress.org/support/topic/wordpress-database-error-cache_key-cannot-be-null/#post-18404008)
 * Hi [@netprofit](https://wordpress.org/support/users/netprofit/),
 * Thanks for contacting us! I would first suggest going to the WordPress plugins
   page, deactivating and deleting the Twitter feed plugin, and then doing a fresh
   install and recreating your feed. If you’ve already done this and it does not
   resolve the problem, please send us a support request through out website [here](https://smashballoon.com/support/)
   and we’ll be happy to take a closer look.
 * Thanks!
   Louis
 *  Thread Starter [NETPROFIT](https://wordpress.org/support/users/netprofit/)
 * (@netprofit)
 * [1 year, 2 months ago](https://wordpress.org/support/topic/wordpress-database-error-cache_key-cannot-be-null/#post-18405086)
 * Hi Louis, 
   thanks for your reply!Unfortunately I don’t think I can create a new
   legacy feed after the reinstall though. So the current shortcodes won’t work 
   afterwards.
 * If I use the “preserve settings” option, the error still persists.
 *  Plugin Support [Smash Balloon Louis](https://wordpress.org/support/users/smashballoonlouis/)
 * (@smashballoonlouis)
 * [1 year, 2 months ago](https://wordpress.org/support/topic/wordpress-database-error-cache_key-cannot-be-null/#post-18405689)
 * Hi [@netprofit](https://wordpress.org/support/users/netprofit/),
 * It’s my pleasure to help and thanks for the update. Could you send us a support
   request through our website [here](https://smashballoon.com/support/)  so we 
   can take a closer look at this for you?
 * Thanks!
   Louis
 *  [Tim](https://wordpress.org/support/users/greller/)
 * (@greller)
 * [1 year, 2 months ago](https://wordpress.org/support/topic/wordpress-database-error-cache_key-cannot-be-null/#post-18407109)
 * Hi [@smashballoonlouis](https://wordpress.org/support/users/smashballoonlouis/),
 * just a quick question before I send the support request:
   Do hashtag-feeds via
   legacy feeds + shortcodes still work in general? Because I saw that creating 
   a new hashtag-feed now requires a subscription. So maybe that’s why it’s throwing
   an error?If yes, I would suggest catching that early on, so it does not come 
   to an error only when trying to insert into the database.
 *  Plugin Support [Smash Balloon Louis](https://wordpress.org/support/users/smashballoonlouis/)
 * (@smashballoonlouis)
 * [1 year, 2 months ago](https://wordpress.org/support/topic/wordpress-database-error-cache_key-cannot-be-null/#post-18407916)
 * Hi [@greller](https://wordpress.org/support/users/greller/),
 * Thank you for the update. Under our current licensing for the Pro plugin, creating
   hashtag feeds requires the Plus version of the plugin or higher. Pro users who
   had an earlier license that allowed hashtag feeds are grandfathered in as long
   as they continued renewing their original license. Due to the rules of this forum
   though, we are only able to provide support here for the free version, so for
   Pro support we’d have to continue on a support request through our website.
   On
   new installations of the current version of the plugin, legacy feeds are not 
   available. In some cases, such as the need to create feeds with dynamic shortcodes,
   we have a way to re-enable this though.
 * I will also share your feedback here with our development team so they can review
   any updates that need to be made to handle cases like this better.
 * Thanks!
   Louis

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘WordPress database error: cache_key cannot be null’ is closed to new 
replies.

 * ![](https://ps.w.org/custom-twitter-feeds/assets/icon-256x256.png?rev=2700808)
 * [Custom Twitter Feeds - A Tweets Widget or X Feed Widget](https://wordpress.org/plugins/custom-twitter-feeds/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/custom-twitter-feeds/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/custom-twitter-feeds/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-twitter-feeds/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-twitter-feeds/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-twitter-feeds/reviews/)

 * 5 replies
 * 3 participants
 * Last reply from: [Smash Balloon Louis](https://wordpress.org/support/users/smashballoonlouis/)
 * Last activity: [1 year, 2 months ago](https://wordpress.org/support/topic/wordpress-database-error-cache_key-cannot-be-null/#post-18407916)
 * Status: resolved