Opened 4 years ago
Last modified 6 weeks ago
#56886 new enhancement
Admin facing add site screen missing search engine visibility field
| Reported by: | imath | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Future Release |
| Component: | Networks and Sites | Version: | |
| Severity: | normal | Keywords: | good-first-bug has-patch needs-testing |
| Cc: | Focuses: | multisite |
Description
When a user wants to add a new site on Multisite configs, they can use the site privacy radio buttons, see screenshot below:
/wp-signup.php
But when a super admin wants to add a new site, they have no way to choose this setting during site creation, they need to create a "public" site, then go into the Reading settings to eventually switch to hidden to search engines. In this particular case, a super admin has less power than a regular user :)
/wp-admin/network/site-new.php
The attached patch is adding these missing site privacy radio buttons to let a super admin decide whether a new site should be "public" or not.
patched /wp-admin/network/site-new.php
Attachments (6)
Change History (34)
#3
follow-up:
↓ 7
@
4 years ago
If there is an E2E test suite that runs in multiste mode, it would be great if some tests could be added to ensure Allow search engines to index this site appears on the relevant page.
@ironprogrammer do you know if such a test suite exits?
This ticket was mentioned in Slack in #core-test by robinwpdeveloper. View the logs.
4 years ago
This ticket was mentioned in PR #3882 on WordPress/wordpress-develop by @audrasjb.
4 years ago
#5
#6
@
4 years ago
- Keywords changes-requested added
The patch needs some updates.
- The markup has changed for this field. See the current markup on the install page. This includes hooks.
- The patch seems to be processing all of the
$blog['meta'], which goes outside the scope of this ticket. intval()should be replaced with(int).wp_unslash()shouldn't be necessary here. It's being converted to an integer.
#7
in reply to: ↑ 3
@
4 years ago
Replying to peterwilsoncc:
If there is an E2E test suite that runs in multiste mode, it would be great if some tests could be added to ensure
Allow search engines to index this siteappears on the relevant page.
@ironprogrammer do you know if such a test suite exits?
I don't believe there are any multisite E2E tests. A great idea though 😅
If this option is added to the multisite admin, could it be worded/designed to have better parity with the single site admin?
I realize the current patch is based on what is currently displayed to users on wp-signup.php, but "Discourage search engines from indexing this site" more accurately reflects this option. It would also simplify the interface if this was a checkbox, rather than radios.
#8
@
4 years ago
- Summary Although users can set a new site's visibility for search engines, the super admin can't :) → Admin facing add site screen missing search engine visibility field
- Version trunk
I think I'd argue that this is an enhancement and not a bug, but I don't feel strongly enough to change the type without others agreeing.
Even though the admin screen shows less to super admins than the front end form, I'm wondering if this was intentional. If I had to guess, I would say that these forms are both intentionally short. But if that conversation did occur, it was likely a really long time ago.
Regardless, it does make sense to me for both locations to match what is available.
This ticket was mentioned in Slack in #core by costdev. View the logs.
4 years ago
#10
@
4 years ago
- Milestone 6.2 → 6.3
- Type defect (bug) → enhancement
This ticket was discussed during the bug scrub. There was agreement by myself, @hellofromTonya and @johnbillion that this is an enhancement, and should be moved to 6.3.
#11
@
4 years ago
As discussed in the bug scrub, this is more of an enhancement than a bug so I'm bumping it to 6.3. I agree that adding this field to the screen mostly makes sense, but I wouldn't want to add too many fields as that's what the settings screens are for.
#13
@
3 years ago
- Milestone 6.3 → 6.4
Given this enhancement still needs some work and as WP 6.3 beta 1 is going to be released in a couple days, let's move this to milestone 6.4.
#14
@
3 years ago
@imath and @audrasjb could you please address the changes requested in #comment:6?
There are not so many :)
#15
@
3 years ago
- Keywords good-first-bug added
Because requested changes are not difficult, I am marking this as good first bug.
But we have 9 days until Beta 1 and if someone is interested to see this change in the 6.4, it needs to be done asap or the ticket will be rescheduled to 6.5.
This ticket was mentioned in Slack in #core by oglekler. View the logs.
3 years ago
#17
@
3 years ago
- Milestone 6.4 → 6.5
Because the patch needs a bit of work, and we are in two days before the Beta 1, I am moving this ticket into 6.5. It can go in trunk as soon as the patch will be ready and trunk open again after 6.4 will be branched out.
This ticket was mentioned in Slack in #core by audrasjb. View the logs.
3 years ago
#20
@
3 years ago
- Milestone 6.5 → Future Release
As per today's bug scrub:
Moving to future release as no update has been proposed since the last punt from 6.4 to 6.5.
#21
@
5 months ago
- Keywords needs-testing added; changes-requested removed
- Milestone Future Release → 7.1
Thanks @helpdesk for the patch!
Moving to 7.1.
#22
@
5 months ago
Tested the latest patch (56886.2.patch) against current trunk in a local WordPress multisite environment.
Environment:
- WordPress trunk (7.1-alpha)
- Multisite enabled
- No additional plugins active
Test steps:
- Applied the patch.
- Visited Network Admin → Sites → Add Site.
- Verified the new “Search engine visibility” checkbox appears on the Add Site screen.
- Created a site with the checkbox checked.
- Confirmed Settings → Reading on the new site shows “Discourage search engines from indexing this site” enabled.
- Created a second site with the checkbox unchecked.
- Confirmed Settings → Reading on the new site shows the setting disabled.
Results:
- Checkbox displays correctly on the Add Site screen.
- Site creation succeeds when the checkbox is checked or unchecked.
- The selected visibility preference is persisted correctly to the newly created site’s Reading Settings.
- Did not observe any regressions during testing.
Patch tests successfully for me.
#23
@
5 months ago
Verified the latest patch for ticket #56886 directly within a local multisite network setup.
Setup Details:
Core: WordPress 7.1-alpha (trunk)
Multisite: Active
Extensions: No active plugins
Verification Process:
- Applied the provided diff to the repository.
- Loaded the Network Admin dashboard and went straight to the Add Site creation form.
- Checked that the new Search Engine Visibility checkbox was visible on screen.
- Generated a new sub-site with the box checked, then logged into that site to confirm the "Discourage search engines" setting was active.
- Generated a second sub-site with the box unchecked, and verified the privacy setting remained disabled on that instance.
The privacy checkbox rendered exactly where intended, sub-site creation completed smoothly in both states, and the indexing preference carried over accurately into the new site options. Everything looks stable with no regression found.
#24
@
4 months ago
With less than a week until 7.1 Beta1, I'd like to check the status of this ticket.
Since multiple patches and PRs are attached, let's first decide which ones to review. It would be best to move forward with https://github.com/WordPress/wordpress-develop/pull/3882/, as it's easier to review and CI checks can be run.
#25
@
4 months ago
- Milestone 7.1 → Future Release
Punting this as the release of 7.1 Beta1 is imminent.
This ticket was mentioned in PR #13309 on WordPress/wordpress-develop by @raulsalvat.
2 months ago
#26
This PR provides a refreshed implementation for #56886 and references the existing PR #3882, whose current implementation predates the later requested changes.
The implementation:
- scopes handling specifically to
blog_public; - preserves the default
public = 1behavior when no visibility option is submitted; - uses the Network Admin Add Site form with a "Search engine visibility" checkbox;
- uses
blog[options][blog_public]rather than genericblog[meta]processing; - avoids
intval()and unnecessarywp_unslash()in the new handling; - preserves the existing
network_site_new_formextension point; - uses the current "Discourage search engines from indexing this site" wording.
Validation performed against current trunk for the exact submitted source change:
git diff --check: PASS- PHP syntax: PASS
- PHPCS for
src/wp-admin/network/site-new.php: PASS - Multisite regression tests: 220 tests, 596 assertions, PASS
tests/phpunit/tests/option/sanitizeOption.php: 65 tests, 80 assertions, PASS- Total selected tests: 285
- Total selected assertions: 676
- Network Admin Add Site form rendering: PASS
- Omitted visibility input creates the site with
blog_public = 1: PASS - Explicit
blog[options][blog_public] = 0creates the site withblog_public = 0: PASS - Temporary behavior-test sites were removed successfully.
Existing PR context: #3882.
This PR does not assert that any attached Trac patch supersedes another attachment.
@raulsalvat commented on PR #13309:
2 months ago
#27
This contribution has been refreshed onto current WordPress trunk.
Current head: 9a5d9c5eab72c5ff4239adf5a28210253984a764
Fresh validation on this exact head:
- 134 successful checks
- 0 failing
- 0 cancelled
- 0 pending
- GitHub reports the PR as MERGEABLE
The implementation is ready for upstream review. The PR body contains the current behavior and validation details.
Related earlier implementation/context: #3882.
#28
@
6 weeks ago
Test Report
Patch tested: PR 13309
Environment
- WordPress: 7.2-alpha (trunk + PR 13309, via the Playground PR previewer)
- Multisite: yes (subdirectory,
enableMultisiteblueprint step) - PHP: 8.3
- Browser: Chrome
- OS: macOS
- Plugins: none
Screenshot
Steps / Results
- Network Admin → Sites → Add Site: the "Search engine visibility" row with the "Discourage search engines from indexing this site" checkbox appears below the admin email notice. ✅
- Created
hidden-sitewith the box checked:- Settings → Reading on the new site: "Discourage search engines" is checked. ✅
- Network → Edit Site → Info: the "Public" attribute is unchecked. ✅
- Front end outputs
<meta name='robots' content='noindex, nofollow' />. ✅
- Created
public-sitewith the box unchecked: Reading setting unchecked, "Public" attribute checked, nonoindexrobots meta. ✅ - Posted
blog[options][blog_public]=-1(unexpected value): the site is created as public, so the default is kept. ✅ - Invalid admin email: the site is rejected via
wp_die()as before, and no site is created. ✅ - Clicking the label toggles the checkbox (
label for="blog_public"). ✅
Code review against comment:6
- Only
blog_publicis handled, not all of$blog['meta']. ✅ - No
intval()orwp_unslash(). It compares against the string'0'. ✅ - Markup "including hooks", compared with
wp-admin/install.php:- The description
<p>has noid, and the checkbox has noaria-describedby.install.phpusesaria-describedby="options-site-visibility-description". Suggest adding both for screen readers. - There's no
has_action( 'blog_privacy_selector' )branch ordo_action( 'blog_privacy_selector' ).install.phpandoptions-reading.phpswitch to radios plus that hook when plugins add extra privacy levels. If parity is wanted, the processing would need to accept those values too (e.g.(int)instead of only'0'). If that's out of scope here, that's fine to note.
- The description
- Minor:
checked( isset( $_POST[...] ) ... )never takes effect, because a failed submission ends inwp_die()and the form is never shown again after a POST. It's harmless.
Notes
In comment:24, @wildworks suggested moving forward with PR 3882. That PR still has all the issues from comment:6 (it processes every blog[meta] key, uses intval( wp_unslash() ), and uses radio buttons). PR 13309 addresses those, so it may be the better PR to review now.
PR 13309 works as expected in my testing. The open question is whether to add the aria-describedby and blog_privacy_selector parity.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)





Test Report
This report validates that the indicated patch addresses the issue.
Patch tested: https://core.trac.wordpress.org/attachment/ticket/56886/56886.patch
Environment
Actual Results
Additional Notes
I have tested the patch and it seems to be the radio buttons appeared as expected. But I'm not sure about the functionality about the search engine. How can I test it in the search engine, please let me know.
Supplemental Artifacts
Before:

After:
