0 votes
19 views
asked by Rookie

Hi, I want to add extra config code in the wordpress installation when it is first created using this command... sudo site example.com -wp=default

I want to add the following lines below in all sites wp-config... I'm trying to keep my server space low from using the same resources. How can I do this?

define( 'WP_PLUGIN_DIR', dirname(__FILE__) . '/wp-content/mydir/plugins' );
define( 'WP_PLUGIN_URL', 'http://example.com/wp-content/mydir/plugins' );

1 Answer

0 votes
answered by Expert

Hi Mike,

I don't understand, just add it. You are free to add whatever you want, just edit the wp-config file and add it.

Regards.

commented by Rookie
I want to edit it automatically when a site is created. Are there any scripts that you know of that can edit it quickly? I know 'sudo nano wp-config' can edit the file but I need to add it in a specific line in the file. I also need to change the mysql hostname in wp-config file from 'localhost' to '12.0.0.1'. I use a cloud sql database from Google.
commented by Expert

Ok. Interesting!

To change the DB host since the beginning you can pass all the custom data in the site command instead of using the "default" option. Check the site command docs.

To automatically add lines when creating the site, this feature is actually in our roadmap  and will be available in January when version 1.7.1 is scheduled to be released. Right now exist and it is called "internal API" and just works with the "stack command", it will be extended soon.

Regards.

commented by Rookie
Sounds good! Thanks! I'm trying to keep this server resources as low as possible. I think Google charges by how much space is used on a server.. I was looking at a certain video on youtube to see how to keep costs low on Google infrastructure.
Welcome to the Community site for Webinoly.

If you have a question about Webinoly, please ask in English or Spanish.

To report a bug, please ask a question here with the bug tag.

News: Webinoly now have support for the newest PHP 7.3.

Donations

Webinoly Support Paypal Donations Webinoly Support Bitcoin Donations

Your regular donations is what keep this project moving forward. If you like Webinoly, buy me a coffee or a beer to show support.

Affiliate Links

It is very important that any visitor to the site read the disclaimer, terms of use and privacy and legal statement before start browsing.

...