This commands prepends a line at the beggining of yourfile
sed -i 1i"define('WP_CACHE', true);" yourfile
To look for many files named wp-config.php and prepend the same text, type this in the shell:
for i in $(find . -name wp-config.php)
do
sed -i 1i"define('<?php WP_CACHE', true); ?>" $i
done
Run this from the main folder where you have all the WP sites.
Related Posts:
- How do I make an HTML table from a database table?
- dbDelta support for FOREIGN KEY
- Modify previous and next text from pagination links
- Does WordPress cache get_user_meta() results?
- wp_customize_image_control default value
- Initialize WordPress environment to use in a real cron script
- Transform php code into a widget?
- class=”parent” for wp_list_pages?
- Display certain amount of posts on taxonomy archive page
- PHP Script within wordpress theme
- if has theme mod
- wp_delete_auto_drafts() deletes links in menus
- Bulk Image upload and one image for each post?
- Remove css styles from specific page
- Why use %d in php when in function
- Submitting form via admin-post.php and handling errors
- Custom plugin issue when trying to use the shortcode twice on a page [closed]
- How to display product cropped thumbnail (150×150) for WooCommerce product categories
- Automatically generate Post/Page from searched Database item?
- Custom Loop through category menu to include sub categories
- Validate emails in array using foreach
- LESS compiler for WordPress
- Change the actual (or viewable) WordPress directory structure
- Add itemprop Schema.org Markup to li Elements in wp_nav_menu
- Get the the title of WordPress after comma
- Use WP_Query in shortcode
- Why is variable not working on custom sql query using wpdb?
- Variable global scope [closed]
- Ajax not working es expected (Returns 0)
- How do I ensure that a piece of hard code only gets called, when on my appointed Blog page?
- WooCommerce Webhooks not firing because of error in wp-includes/meta.php
- Increase offset while looping
- WordPress PHP version won’t change from 5.2 [closed]
- Secondary navigation menu on one page
- Remove class in nav_menu_link_attibutes filter
- NGINX rewrite rules for multisite
- How to separate HTML and WordPress files
- WordPress automatically adding comments to inserted PHP code how to disable? [closed]
- How can I make an object available through the entire site?
- WordPress admin-ajax.php
- Plugin PHP file gives error 500 [closed]
- Site throws 500 error after upgrading from PHP 5.6 to 7.X
- Find a way to retrive data updated through metabox plugin to web page
- How to pass a PHP $_GET variable and fetch/output it?
- zip unzip attachments in wordpress
- ACF put a comma after the last repeater field value [closed]
- parsing nested blocks (in columns, etc) via PHP
- Show ACF field with link to ultimate member profile/WordPress user profile below the post (single post layout)
- Redirect first comment (Thanks for comment) with show Autor name and beginning of the comment
- Guttenburg and Classic Editor – How to use the custom guttenburg block in classic editor?
- How to get current post category details inside “loop”?
- Login to wordpress using another sites authentication.
- echo var into wp_query
- Using wordpress function to retrieve data
- Creating a child theme after numerous edits to parent theme
- Get the alt text of the image in a array
- Admin Menu new tab external link
- Editing Theme Files on WordPress.com-hosted Site [closed]
- Editor capabilities – admin_init
- Unzip file in functions.php, and add it to cron
- Download file and redirect to page or vice versa
- Password protect URLs
- Add Block Before Entry Title Using PHP
- How to correctly escape an echo
- Give ID to divs inside the loop
- Dynamically populate parameter in Gravity Forms using PHP
- Display values of current POST request on page
- I have a button in homepage theme in 2 language
- How to get specific multiple pages excerpts at homepage?
- Having trouble creating two shortcodes, one for logged in user and one for visitors
- Trying to get post ID outside loop on blog page
- Learndash: Customize user enroll time
- WordPress Slider is not working
- Comments on my custom post type
- Including user data in “new user notification email”
- get Woocommerce product format json for WP_Query
- WordPress login with external php script
- Wp-query output correct, but the loop shows one less item (only sometimes)
- Get list of posts from attachment
- Refresh page after login with litespeed cache
- The plugin generated 225 characters of unexpected output during activation
- remove_action() not working in page template – Genesis
- Create dynamic content from one WP page to multiple other pages
- ajax form with multiple submit buttons and values
- How to map my php files as the files for pages
- Property value of null when value is assigned inside a method hooked to the wp action hook
- Unserializeing multiple column values that are stored in one database results variable
- WordPress Errors after Host Migration
- Keeps asking Connection Information upon update to 3.5.1 (but not for plugins?)
- split searchresults into different topics?
- How can I add more code to this?
- Display custom meta box in my template file
- wp_enqueue_style conflict when using in different action hooks
- WordPress developer
- Use HTML Form Data in PHP Function – WordPress Admin Page
- Front-end major break after upgrade PHP 8.0 [closed]
- wp_enqueue_scripts with JS script as a string
- Edit Error Page style
- PHP $_SESSION array – only showing current index
- How can I use AJAX in child theme template?